<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <title>Permissions</title>
<style data-fill-with="stylesheet">/******************************************************************************
 *                   Style sheet for the W3C specifications                   *
 *
 * Special classes handled by this style sheet include:
 *
 * Indices
 *   - .toc for the Table of Contents (<ol class="toc">)
 *     + <span class="secno"> for the section numbers
 *   - #toc for the Table of Contents (<nav id="toc">)
 *   - ul.index for Indices (<a href="#ref">term</a><span>, in §N.M</span>)
 *   - table.index for Index Tables (e.g. for properties or elements)
 *
 * Structural Markup
 *   - table.data for general data tables
 *     -> use 'scope' attribute, <colgroup>, <thead>, and <tbody> for best results !
 *     -> use <table class='complex data'> for extra-complex tables
 *     -> use <td class='long'> for paragraph-length cell content
 *     -> use <td class='pre'> when manual line breaks/indentation would help readability
 *   - dl.switch for switch statements
 *   - ol.algorithm for algorithms (helps to visualize nesting)
 *   - .figure and .caption (HTML4) and figure and figcaption (HTML5)
 *     -> .sidefigure for right-floated figures
 *   - ins/del
 *
 * Code
 *   - pre and code
 *
 * Special Sections
 *   - .note       for informative notes             (div, p, span, aside, details)
 *   - .example    for informative examples          (div, p, pre, span)
 *   - .issue      for issues                        (div, p, span)
 *   - .assertion  for assertions                    (div, p, span)
 *   - .advisement for loud normative statements     (div, p, strong)
 *   - .annoying-warning for spec obsoletion notices (div, aside, details)
 *
 * Definition Boxes
 *   - pre.def   for WebIDL definitions
 *   - table.def for tables that define other entities (e.g. CSS properties)
 *   - dl.def    for definition lists that define other entitles (e.g. HTML elements)
 *
 * Numbering
 *   - .secno for section numbers in .toc and headings (<span class='secno'>3.2</span>)
 *   - .marker for source-inserted example/figure/issue numbers (<span class='marker'>Issue 4</span>)
 *   - ::before styled for CSS-generated issue/example/figure numbers:
 *     -> Documents wishing to use this only need to add
 *        figcaption::before,
 *        .caption::before { content: "Figure "  counter(figure) " ";  }
 *        .example::before { content: "Example " counter(example) " "; }
 *        .issue::before   { content: "Issue "   counter(issue) " ";   }
 *
 * Header Stuff (ignore, just don't conflict with these classes)
 *   - .head for the header
 *   - .copyright for the copyright
 *
 * Miscellaneous
 *   - .overlarge for things that should be as wide as possible, even if
 *     that overflows the body text area. This can be used on an item or
 *     on its container, depending on the effect desired.
 *     Note that this styling basically doesn't help at all when printing,
 *     since A4 paper isn't much wider than the max-width here.
 *     It's better to design things to fit into a narrower measure if possible.
 *   - js-added ToC jump links (see fixup.js)
 *
 ******************************************************************************/

/******************************************************************************/
/*                                   Body                                     */
/******************************************************************************/

	body {
		counter-reset: example figure issue;

		/* Layout */
		max-width: 50em;               /* limit line length to 50em for readability   */
		margin: 0 auto;                /* center text within page                     */
		padding: 1.6em 1.5em 2em 50px; /* assume 16px font size for downlevel clients */
		padding: 1.6em 1.5em 2em calc(26px + 1.5em); /* leave space for status flag     */

		/* Typography */
		line-height: 1.5;
		font-family: sans-serif;
		widows: 2;
		orphans: 2;
		word-wrap: break-word;
		overflow-wrap: break-word;
		hyphens: auto;

		/* Colors */
		color: black;
		background: white top left fixed no-repeat;
		background-size: 25px auto;
	}


/******************************************************************************/
/*                         Front Matter & Navigation                          */
/******************************************************************************/

/** Header ********************************************************************/

	div.head { margin-bottom: 1em }
	div.head hr { border-style: solid; }

	div.head h1 {
		font-weight: bold;
		margin: 0 0 .1em;
		font-size: 220%;
	}

	div.head h2 { margin-bottom: 1.5em;}

/** W3C Logo ******************************************************************/

	.head .logo {
		float: right;
		margin: 0.4rem 0 0.2rem .4rem;
	}

	.head img[src*="logos/W3C"] {
		display: block;
		border: solid #1a5e9a;
		border-width: .65rem .7rem .6rem;
		border-radius: .4rem;
		background: #1a5e9a;
		color: white;
		font-weight: bold;
	}

	.head a:hover > img[src*="logos/W3C"],
	.head a:focus > img[src*="logos/W3C"] {
		opacity: .8;
	}

	.head a:active > img[src*="logos/W3C"] {
		background: #c00;
		border-color: #c00;
	}

	/* see also additional rules in Link Styling section */

/** Copyright *****************************************************************/

	p.copyright,
	p.copyright small { font-size: small }

/** Back to Top / ToC Toggle **************************************************/

	@media print {
		#toc-nav {
			display: none;
		}
	}
	@media not print {
		#toc-nav {
			position: fixed;
			z-index: 2;
			bottom: 0; left: 0;
			margin: 0;
			min-width: 1.33em;
			border-top-right-radius: 2rem;
			box-shadow: 0 0 2px;
			font-size: 1.5em;
			color: black;
		}
		#toc-nav > a {
			display: block;
			white-space: nowrap;

			height: 1.33em;
			padding: .1em 0.3em;
			margin: 0;

			background: white;
			box-shadow: 0 0 2px;
			border: none;
			border-top-right-radius: 1.33em;
			background: white;
		}
		#toc-nav > #toc-jump {
			padding-bottom: 2em;
			margin-bottom: -1.9em;
		}

		#toc-nav > a:hover,
		#toc-nav > a:focus {
			background: #f8f8f8;
		}
		#toc-nav > a:not(:hover):not(:focus) {
			color: #707070;
		}

		/* statusbar gets in the way on keyboard focus; remove once browsers fix */
		#toc-nav > a[href="#toc"]:not(:hover):focus:last-child {
			padding-bottom: 1.5rem;
		}

		#toc-nav:not(:hover) > a:not(:focus) > span + span {
			/* Ideally this uses :focus-within on #toc-nav */
			display: none;
		}
		#toc-nav > a > span + span {
			padding-right: 0.2em;
		}

		#toc-toggle-inline {
			vertical-align: 0.05em;
			font-size: 80%;
			color: gray;
			color: hsla(203,20%,40%,.7);
			border-style: none;
			background: transparent;
			position: relative;
		}
		#toc-toggle-inline:hover:not(:active),
		#toc-toggle-inline:focus:not(:active) {
			text-shadow: 1px 1px silver;
			top: -1px;
			left: -1px;
		}

		#toc-nav :active {
			color: #C00;
		}
	}

/** ToC Sidebar ***************************************************************/

	/* Floating sidebar */
	@media screen {
		body.toc-sidebar #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			max-width: 80%;
			max-width: calc(100% - 2em - 26px);
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body.toc-sidebar #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}
		body.toc-sidebar #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	/* Hide main scroller when only the ToC is visible anyway */
	@media screen and (max-width: 28em) {
		body.toc-sidebar {
			overflow: hidden;
		}
	}

	/* Sidebar with its own space */
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) #toc {
			position: fixed;
			top: 0; bottom: 0;
			left: 0;
			width: 23.5em;
			overflow: auto;
			padding: 0 1em;
			padding-left: 42px;
			padding-left: calc(1em + 26px);
			background: inherit;
			background-color: #f7f8f9;
			z-index: 1;
			box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
		}
		body:not(.toc-inline) #toc h2 {
			margin-top: .8rem;
			font-variant: small-caps;
			font-variant: all-small-caps;
			text-transform: lowercase;
			font-weight: bold;
			color: gray;
			color: hsla(203,20%,40%,.7);
		}

		body:not(.toc-inline) {
			padding-left: 29em;
		}
		/* See also Overflow section at the bottom */

		body:not(.toc-inline) #toc-jump:not(:focus) {
			width: 0;
			height: 0;
			padding: 0;
			position: absolute;
			overflow: hidden;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) {
			margin: 0 4em;
		}
	}

/******************************************************************************/
/*                                Sectioning                                  */
/******************************************************************************/

/** Headings ******************************************************************/

	h1, h2, h3, h4, h5, h6, dt {
		page-break-after: avoid;
		page-break-inside: avoid;
		font: 100% sans-serif;   /* Reset all font styling to clear out UA styles */
		font-family: inherit;    /* Inherit the font family. */
		line-height: 1.2;        /* Keep wrapped headings compact */
		hyphens: manual;         /* Hyphenated headings look weird */
	}

	h2, h3, h4, h5, h6 {
		margin-top: 3rem;
	}

	h1, h2, h3 {
		color: #005A9C;
		background: transparent;
	}

	h1 { font-size: 170%; }
	h2 { font-size: 140%; }
	h3 { font-size: 120%; }
	h4 { font-weight: bold; }
	h5 { font-style: italic; }
	h6 { font-variant: small-caps; }
	dt { font-weight: bold; }

/** Subheadings ***************************************************************/

	h1 + h2,
	#subtitle {
		/* #subtitle is a subtitle in an H2 under the H1 */
		margin-top: 0;
	}
	h2 + h3,
	h3 + h4,
	h4 + h5,
	h5 + h6 {
		margin-top: 1.2em; /* = 1 x line-height */
	}

/** Section divider ***********************************************************/

	:not(.head) > hr {
		font-size: 1.5em;
		text-align: center;
		margin: 1em auto;
		height: auto;
		border: transparent solid 0;
		background: transparent;
	}
	:not(.head) > hr::before {
		content: "\2727\2003\2003\2727\2003\2003\2727";
	}

/******************************************************************************/
/*                            Paragraphs and Lists                            */
/******************************************************************************/

	p {
		margin: 1em 0;
	}

	dd > p:first-child,
	li > p:first-child {
		margin-top: 0;
	}

	ul, ol {
		margin-left: 0;
		padding-left: 2em;
	}

	li {
		margin: 0.25em 0 0.5em;
		padding: 0;
	}

	dl dd {
		margin: 0 0 .5em 2em;
	}

	.head dd + dd { /* compact for header */
		margin-top: -.5em;
	}

	/* Style for algorithms */
	ol.algorithm ol:not(.algorithm),
	.algorithm > ol ol:not(.algorithm) {
	 border-left: 0.5em solid #DEF;
	}

	/* Put nice boxes around each algorithm. */
	[data-algorithm]:not(.heading) {
	  padding: .5em;
	  border: thin solid #ddd; border-radius: .5em;
	  margin: .5em calc(-0.5em - 1px);
	}
	[data-algorithm]:not(.heading) > :first-child {
	  margin-top: 0;
	}
	[data-algorithm]:not(.heading) > :last-child {
	  margin-bottom: 0;
	}

	/* Style for switch/case <dl>s */
	dl.switch > dd > ol.only,
	dl.switch > dd > .only > ol {
	 margin-left: 0;
	}
	dl.switch > dd > ol.algorithm,
	dl.switch > dd > .algorithm > ol {
	 margin-left: -2em;
	}
	dl.switch {
	 padding-left: 2em;
	}
	dl.switch > dt {
	 text-indent: -1.5em;
	 margin-top: 1em;
	}
	dl.switch > dt + dt {
	 margin-top: 0;
	}
	dl.switch > dt::before {
	 content: '\21AA';
	 padding: 0 0.5em 0 0;
	 display: inline-block;
	 width: 1em;
	 text-align: right;
	 line-height: 0.5em;
	}

/** Terminology Markup ********************************************************/


/******************************************************************************/
/*                                 Inline Markup                              */
/******************************************************************************/

/** Terminology Markup ********************************************************/
	dfn   { /* Defining instance */
		font-weight: bolder;
	}
	a > i { /* Instance of term */
		font-style: normal;
	}
	dt dfn code, code.idl {
		font-size: medium;
	}
	dfn var {
		font-style: normal;
	}

/** Change Marking ************************************************************/

	del { color: red;  text-decoration: line-through; }
	ins { color: #080; text-decoration: underline;    }

/** Miscellaneous improvements to inline formatting ***************************/

	sup {
		vertical-align: super;
		font-size: 80%
	}

/******************************************************************************/
/*                                    Code                                    */
/******************************************************************************/

/** General monospace/pre rules ***********************************************/

	pre, code, samp {
		font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;
		font-size: .9em;
		page-break-inside: avoid;
		hyphens: none;
		text-transform: none;
	}
	pre code,
	code code {
		font-size: 100%;
	}

	pre {
		margin-top: 1em;
		margin-bottom: 1em;
		overflow: auto;
	}

/** Inline Code fragments *****************************************************/

  /* Do something nice. */

/******************************************************************************/
/*                                    Links                                   */
/******************************************************************************/

/** General Hyperlinks ********************************************************/

	/* We hyperlink a lot, so make it less intrusive */
	a[href] {
		color: #034575;
		text-decoration: none;
		border-bottom: 1px solid #707070;
		/* Need a bit of extending for it to look okay */
		padding: 0 1px 0;
		margin: 0 -1px 0;
	}
	a:visited {
		border-bottom-color: #BBB;
	}

	/* Use distinguishing colors when user is interacting with the link */
	a[href]:focus,
	a[href]:hover {
		background: #f8f8f8;
		background: rgba(75%, 75%, 75%, .25);
		border-bottom-width: 3px;
		margin-bottom: -2px;
	}
	a[href]:active {
		color: #C00;
		border-color: #C00;
	}

	/* Backout above styling for W3C logo */
	.head .logo,
	.head .logo a {
		border: none;
		text-decoration: none;
		background: transparent;
	}

/******************************************************************************/
/*                                    Images                                  */
/******************************************************************************/

	img {
		border-style: none;
	}

	/* For autogen numbers, add
	   .caption::before, figcaption::before { content: "Figure " counter(figure) ". "; }
	*/

	figure, .figure, .sidefigure {
		page-break-inside: avoid;
		text-align: center;
		margin: 2.5em 0;
	}
	.figure img,    .sidefigure img,    figure img,
	.figure object, .sidefigure object, figure object {
		max-width: 100%;
		margin: auto;
	}
	.figure pre, .sidefigure pre, figure pre {
		text-align: left;
		display: table;
		margin: 1em auto;
	}
	.figure table, figure table {
		margin: auto;
	}
	@media screen and (min-width: 20em) {
		.sidefigure {
			float: right;
			width: 50%;
			margin: 0 0 0.5em 0.5em
		}
	}
	.caption, figcaption, caption {
		font-style: italic;
		font-size: 90%;
	}
	.caption::before, figcaption::before, figcaption > .marker {
		font-weight: bold;
	}
	.caption, figcaption {
		counter-increment: figure;
	}

	/* DL list is indented 2em, but figure inside it is not */
	dd > .figure, dd > figure { margin-left: -2em }

/******************************************************************************/
/*                             Colored Boxes                                  */
/******************************************************************************/

	.issue, .note, .example, .assertion, .advisement, blockquote {
		padding: .5em;
		border: .5em;
		border-left-style: solid;
		page-break-inside: avoid;
	}
	span.issue, span.note {
		padding: .1em .5em .15em;
		border-right-style: solid;
	}

	.issue,
	.note,
	.example,
	.advisement,
	.assertion,
	blockquote {
		margin: 1em auto;
	}
	.note  > p:first-child,
	.issue > p:first-child,
	blockquote > :first-child {
		margin-top: 0;
	}
	blockquote > :last-child {
		margin-bottom: 0;
	}

/** Blockquotes ***************************************************************/

	blockquote {
		border-color: silver;
	}

/** Open issue ****************************************************************/

	.issue {
		border-color: #E05252;
		background: #FBE9E9;
		counter-increment: issue;
		overflow: auto;
	}
	.issue::before, .issue > .marker {
		text-transform: uppercase;
		color: #AE1E1E;
		padding-right: 1em;
		text-transform: uppercase;
	}
	/* Add .issue::before { content: "Issue " counter(issue) " "; } for autogen numbers,
	   or use class="marker" to mark up the issue number in source. */

/** Example *******************************************************************/

	.example {
		border-color: #E0CB52;
		background: #FCFAEE;
		counter-increment: example;
		overflow: auto;
		clear: both;
	}
	.example::before, .example > .marker {
		text-transform: uppercase;
		color: #827017;
		min-width: 7.5em;
		display: block;
	}
	/* Add .example::before { content: "Example " counter(example) " "; } for autogen numbers,
	   or use class="marker" to mark up the example number in source. */

/** Non-normative Note ********************************************************/

	.note {
		border-color: #52E052;
		background: #E9FBE9;
		overflow: auto;
	}

	.note::before, .note > .marker,
	details.note > summary::before,
	details.note > summary > .marker {
		text-transform: uppercase;
		display: block;
		color: hsl(120, 70%, 30%);
	}
	/* Add .note::before { content: "Note"; } for autogen label,
	   or use class="marker" to mark up the label in source. */

	details.note > summary {
		display: block;
		color: hsl(120, 70%, 30%);
	}
	details.note[open] > summary {
		border-bottom: 1px silver solid;
	}

/** Assertion Box *************************************************************/
	/*  for assertions in algorithms */

	.assertion {
		border-color: #AAA;
		background: #EEE;
	}

/** Advisement Box ************************************************************/
	/*  for attention-grabbing normative statements */

	.advisement {
		border-color: orange;
		border-style: none solid;
		background: #FFEECC;
	}
	strong.advisement {
		display: block;
		text-align: center;
	}
	.advisement > .marker {
		color: #B35F00;
	}

/** Spec Obsoletion Notice ****************************************************/
	/* obnoxious obsoletion notice for older/abandoned specs. */

	details {
		display: block;
	}
	summary {
		font-weight: bolder;
	}

	.annoying-warning:not(details),
	details.annoying-warning:not([open]) > summary,
	details.annoying-warning[open] {
		background: #fdd;
		color: red;
		font-weight: bold;
		padding: .75em 1em;
		border: thick red;
		border-style: solid;
		border-radius: 1em;
	}
	.annoying-warning :last-child {
		margin-bottom: 0;
	}

@media not print {
	details.annoying-warning[open] {
		position: fixed;
		left: 1em;
		right: 1em;
		bottom: 1em;
		z-index: 1000;
	}
}

	details.annoying-warning:not([open]) > summary {
		text-align: center;
	}

/** Entity Definition Boxes ***************************************************/

	.def {
		padding: .5em 1em;
		background: #DEF;
		margin: 1.2em 0;
		border-left: 0.5em solid #8CCBF2;
	}

/******************************************************************************/
/*                                    Tables                                  */
/******************************************************************************/

	th, td {
		text-align: left;
		text-align: start;
	}

/** Property/Descriptor Definition Tables *************************************/

	table.def {
		/* inherits .def box styling, see above */
		width: 100%;
		border-spacing: 0;
	}

	table.def td,
	table.def th {
		padding: 0.5em;
		vertical-align: baseline;
		border-bottom: 1px solid #bbd7e9;
	}

	table.def > tbody > tr:last-child th,
	table.def > tbody > tr:last-child td {
		border-bottom: 0;
	}

	table.def th {
		font-style: italic;
		font-weight: normal;
		padding-left: 1em;
		width: 3em;
	}

	/* For when values are extra-complex and need formatting for readability */
	table td.pre {
		white-space: pre-wrap;
	}

	/* A footnote at the bottom of a def table */
	table.def           td.footnote {
		padding-top: 0.6em;
	}
	table.def           td.footnote::before {
		content: " ";
		display: block;
		height: 0.6em;
		width: 4em;
		border-top: thin solid;
	}

/** Data tables (and properly marked-up index tables) *************************/
	/*
		 <table class="data"> highlights structural relationships in a table
		 when correct markup is used (e.g. thead/tbody, th vs. td, scope attribute)

		 Use class="complex data" for particularly complicated tables --
		 (This will draw more lines: busier, but clearer.)

		 Use class="long" on table cells with paragraph-like contents
		 (This will adjust text alignment accordingly.)
		 Alternately use class="longlastcol" on tables, to have the last column assume "long".
	*/

	table {
		word-wrap: normal;
		overflow-wrap: normal;
		hyphens: manual;
	}

	table.data,
	table.index {
		margin: 1em auto;
		border-collapse: collapse;
		border: hidden;
		width: 100%;
	}
	table.data caption,
	table.index caption {
		max-width: 50em;
		margin: 0 auto 1em;
	}

	table.data td,  table.data th,
	table.index td, table.index th {
		padding: 0.5em 1em;
		border-width: 1px;
		border-color: silver;
		border-top-style: solid;
	}

	table.data thead td:empty {
		padding: 0;
		border: 0;
	}

	table.data  thead,
	table.index thead,
	table.data  tbody,
	table.index tbody {
		border-bottom: 2px solid;
	}

	table.data colgroup,
	table.index colgroup {
		border-left: 2px solid;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		border-right: 2px solid;
		border-top: 1px solid silver;
		padding-right: 1em;
	}

	table.data th[colspan],
	table.data td[colspan] {
		text-align: center;
	}

	table.complex.data th,
	table.complex.data td {
		border: 1px solid silver;
		text-align: center;
	}

	table.data.longlastcol td:last-child,
	table.data td.long {
	 vertical-align: baseline;
	 text-align: left;
	}

	table.data img {
		vertical-align: middle;
	}


/*
Alternate table alignment rules

	table.data,
	table.index {
		text-align: center;
	}

	table.data  thead th[scope="row"],
	table.index thead th[scope="row"] {
		text-align: right;
	}

	table.data  tbody th:first-child,
	table.index tbody th:first-child  {
		text-align: right;
	}

Possible extra rowspan handling

	table.data  tbody th[rowspan]:not([rowspan='1']),
	table.index tbody th[rowspan]:not([rowspan='1']),
	table.data  tbody td[rowspan]:not([rowspan='1']),
	table.index tbody td[rowspan]:not([rowspan='1']) {
		border-left: 1px solid silver;
	}

	table.data  tbody th[rowspan]:first-child,
	table.index tbody th[rowspan]:first-child,
	table.data  tbody td[rowspan]:first-child,
	table.index tbody td[rowspan]:first-child{
		border-left: 0;
		border-right: 1px solid silver;
	}
*/

/******************************************************************************/
/*                                  Indices                                   */
/******************************************************************************/


/** Table of Contents *********************************************************/

	.toc a {
		/* More spacing; use padding to make it part of the click target. */
		padding-top: 0.1rem;
		/* Larger, more consistently-sized click target */
		display: block;
		/* Reverse color scheme */
		color: black;
		border-color: #3980B5;
		border-bottom-width: 3px !important;
		margin-bottom: 0px !important;
	}
	.toc a:visited {
		border-color: #054572;
	}
	.toc a:not(:focus):not(:hover) {
		/* Allow colors to cascade through from link styling */
		border-bottom-color: transparent;
	}

	.toc, .toc ol, .toc ul, .toc li {
		list-style: none; /* Numbers must be inlined into source */
		/* because generated content isn't search/selectable and markers can't do multilevel yet */
		margin:  0;
		padding: 0;
		line-height: 1.1rem; /* consistent spacing */
	}

	/* ToC not indented until third level, but font style & margins show hierarchy */
	.toc > li             { font-weight: bold;   }
	.toc > li li          { font-weight: normal; }
	.toc > li li li       { font-size:   95%;    }
	.toc > li li li li    { font-size:   90%;    }
	.toc > li li li li .secno { font-size: 85%; }
	.toc > li li li li li { font-size:   85%;    }
	.toc > li li li li li .secno { font-size: 100%; }

	/* @supports not (display:grid) { */
		.toc > li             { margin: 1.5rem 0;    }
		.toc > li li          { margin: 0.3rem 0;    }
		.toc > li li li       { margin-left: 2rem;   }

		/* Section numbers in a column of their own */
		.toc .secno {
			float: left;
			width: 4rem;
			white-space: nowrap;
		}

		.toc li {
			clear: both;
		}

		:not(li) > .toc              { margin-left:  5rem; }
		.toc .secno                  { margin-left: -5rem; }
		.toc > li li li .secno       { margin-left: -7rem; }
		.toc > li li li li .secno    { margin-left: -9rem; }
		.toc > li li li li li .secno { margin-left: -11rem; }

		/* Tighten up indentation in narrow ToCs */
		@media (max-width: 30em) {
			:not(li) > .toc              { margin-left:  4rem; }
			.toc .secno                  { margin-left: -4rem; }
			.toc > li li li              { margin-left:  1rem; }
			.toc > li li li .secno       { margin-left: -5rem; }
			.toc > li li li li .secno    { margin-left: -6rem; }
			.toc > li li li li li .secno { margin-left: -7rem; }
		}
	/* } */

	@supports (display:grid) and (display:contents) {
		/* Use #toc over .toc to override non-@supports rules. */
		#toc {
			display: grid;
			align-content: start;
			grid-template-columns: auto 1fr;
			grid-column-gap: 1rem;
			column-gap: 1rem;
			grid-row-gap: .6rem;
			row-gap: .6rem;
		}
		#toc h2 {
			grid-column: 1 / -1;
			margin-bottom: 0;
		}
		#toc ol,
		#toc li,
		#toc a {
			display: contents;
			/* Switch <a> to subgrid when supported */
		}
		#toc span {
			margin: 0;
		}
		#toc > .toc > li > a > span {
			/* The spans of the top-level list,
			   comprising the first items of each top-level section. */
			margin-top: 1.1rem;
		}
		#toc#toc .secno { /* Ugh, need more specificity to override base.css */
			grid-column: 1;
			width: auto;
			margin-left: 0;
		}
		#toc .content {
			grid-column: 2;
			width: auto;
			margin-right: 1rem;
		}
		#toc .content:hover {
			background: rgba(75%, 75%, 75%, .25);
			border-bottom: 3px solid #054572;
			margin-bottom: -3px;
		}
		#toc li li li .content {
			margin-left: 1rem;
		}
		#toc li li li li .content {
			margin-left: 2rem;
		}
	}


/** Index *********************************************************************/

	/* Index Lists: Layout */
	ul.index       { margin-left: 0; columns: 15em; text-indent: 1em hanging; }
	ul.index li    { margin-left: 0; list-style: none; break-inside: avoid; }
	ul.index li li { margin-left: 1em }
	ul.index dl    { margin-top: 0; }
	ul.index dt    { margin: .2em 0 .2em 20px;}
	ul.index dd    { margin: .2em 0 .2em 40px;}
	/* Index Lists: Typography */
	ul.index ul,
	ul.index dl { font-size: smaller; }
	@media not print {
		ul.index li span {
			white-space: nowrap;
			color: transparent; }
		ul.index li a:hover + span,
		ul.index li a:focus + span {
			color: #707070;
		}
	}

/** Index Tables *****************************************************/
	/* See also the data table styling section, which this effectively subclasses */

	table.index {
		font-size: small;
		border-collapse: collapse;
		border-spacing: 0;
		text-align: left;
		margin: 1em 0;
	}

	table.index td,
	table.index th {
		padding: 0.4em;
	}

	table.index tr:hover td:not([rowspan]),
	table.index tr:hover th:not([rowspan]) {
		background: #f7f8f9;
	}

	/* The link in the first column in the property table (formerly a TD) */
	table.index th:first-child a {
		font-weight: bold;
	}

/******************************************************************************/
/*                                    Print                                   */
/******************************************************************************/

	@media print {
		/* Pages have their own margins. */
		html {
			margin: 0;
		}
		/* Serif for print. */
		body {
			font-family: serif;
		}
	}
	@page {
		margin: 1.5cm 1.1cm;
	}

/******************************************************************************/
/*                                    Legacy                                  */
/******************************************************************************/

	/* This rule is inherited from past style sheets. No idea what it's for. */
	.hide { display: none }



/******************************************************************************/
/*                             Overflow Control                               */
/******************************************************************************/

	.figure .caption, .sidefigure .caption, figcaption {
		/* in case figure is overlarge, limit caption to 50em */
		max-width: 50rem;
		margin-left: auto;
		margin-right: auto;
	}
	.overlarge {
		/* Magic to create good table positioning:
		   "content column" is 50ems wide at max; less on smaller screens.
		   Extra space (after ToC + content) is empty on the right.

		   1. When table < content column, centers table in column.
		   2. When content < table < available, left-aligns.
		   3. When table > available, fills available + scroll bar.
		*/ 
		display: grid;
		grid-template-columns: minmax(0, 50em);
	}
	.overlarge > table {
		/* limit preferred width of table */
		max-width: 50em;
		margin-left: auto;
		margin-right: auto;
	}

	@media (min-width: 55em) {
		.overlarge {
			margin-right: calc(13px + 26.5rem - 50vw);
			max-width: none;
		}
	}
	@media screen and (min-width: 78em) {
		body:not(.toc-inline) .overlarge {
			/* 30.5em body padding 50em content area */
			margin-right: calc(40em - 50vw) !important;
		}
	}
	@media screen and (min-width: 90em) {
		body:not(.toc-inline) .overlarge {
			/* 4em html margin 30.5em body padding 50em content area */
			margin-right: calc(84.5em - 100vw) !important;
		}
	}

	@media not print {
		.overlarge {
			overflow-x: auto;
			/* See Lea Verou's explanation background-attachment:
			 * http://lea.verou.me/2012/04/background-attachment-local/
			 *
			background: top left  / 4em 100% linear-gradient(to right,  #ffffff, rgba(255, 255, 255, 0)) local,
			            top right / 4em 100% linear-gradient(to left, #ffffff, rgba(255, 255, 255, 0)) local,
			            top left  / 1em 100% linear-gradient(to right,  #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            top right / 1em 100% linear-gradient(to left, #c3c3c5, rgba(195, 195, 197, 0)) scroll,
			            white;
			background-repeat: no-repeat;
			*/
		}
	}
</style>
  <link href="https://www.w3.org/TR/permissions/" rel="canonical">
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-var-click-highlighting */

    var { cursor: pointer; }
    var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
    var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
    var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
    var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
    var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
    var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
    var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
    </style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */
pre.idl.highlight { color: #708090; }
.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">Permissions</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <div data-fill-with="spec-metadata">
    <dl>
     <dt>This version:
     <dd><a class="u-url" href="https://w3c.github.io/permissions/">https://w3c.github.io/permissions/</a>
     <dt>Latest published version:
     <dd><a href="https://www.w3.org/TR/permissions/">https://www.w3.org/TR/permissions/</a>
     <dt>Previous Versions:
     <dd><a href="https://www.w3.org/TR/2015/WD-permissions-20150407/" rel="prev">https://www.w3.org/TR/2015/WD-permissions-20150407/</a>
     <dd><a href rel="prev"></a>
     <dt>Feedback:
     <dd><span><a href="mailto:public-webappsec@w3.org?subject=%5Bpermissions%5D%20YOUR%20TOPIC%20HERE">public-webappsec@w3.org</a> with subject line “<kbd>[permissions] <i data-lt>… message topic …</i></kbd>”</span>
     <dt class="editor">Editors:
     <dd class="editor p-author h-card vcard" data-editor-id="45389"><span class="p-name fn">Mounir Lamouri</span> (<a class="p-org org" href="https://google.com/">Google Inc.</a>)
     <dd class="editor p-author h-card vcard" data-editor-id="39125"><span class="p-name fn">Marcos Cáceres</span> (<a class="p-org org" href="https://mozilla.com/">Mozilla</a>)
     <dd class="editor p-author h-card vcard" data-editor-id="72192"><span class="p-name fn">Jeffrey Yasskin</span> (<a class="p-org org" href="https://google.com/">Google Inc.</a>)
     <dt>Participate:
     <dd><a href="https://github.com/w3c/permissions">We are on Github.</a>
     <dd><a href="https://github.com/w3c/permissions/issues">File a bug.</a>
     <dd><a href="https://github.com/w3c/permissions/commits/gh-pages">Commit history.</a>
     <dt>Implementation status:
     <dd><a href="https://code.google.com/p/chromium/issues/detail?id=437770">Blink/Chromium</a>
     <dd><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1105827">Gecko</a>
     <dd>
    </dl>
   </div>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>The <cite>Permissions Standard</cite> defines common infrastructure for other specifications that need to interact with browser permissions. It also defines an API to allow web applications to query and request changes to the status of a given permission.</p>
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This is a public copy of the editors’ draft.
	It is provided for discussion only and may change at any moment.
	Its publication here does not imply endorsement of its contents by W3C.
	Don’t cite this document other than as work in progress. </p>
   <p> <strong>Changes to this document may be tracked at <a href="https://github.com/w3c/webappsec">https://github.com/w3c/webappsec</a>.</strong> </p>
   <p> The (<a href="https://lists.w3.org/Archives/Public/public-webappsec/">archived</a>) public mailing list <a href="mailto:public-webappsec@w3.org?Subject=%5Bpermissions%5D%20PUT%20SUBJECT%20HERE">public-webappsec@w3.org</a> (see <a href="https://www.w3.org/Mail/Request">instructions</a>)
	is preferred for discussion of this specification.
	When sending e-mail,
	please put the text “permissions” in the subject,
	preferably like this:
	“[permissions] <em>…summary of comment…</em>” </p>
   <p> This document was produced by the <a href="https://www.w3.org/2011/webappsec/">Web Application Security Working Group</a>. </p>
   <p> This document was produced by a group operating under
	the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
	W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/49309/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
	that page also includes instructions for disclosing a patent.
	An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
   <p> This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li><a href="#scope-of-this-document"><span class="secno">1</span> <span class="content"> Scope of this document </span></a>
    <li><a href="#privacy-considerations"><span class="secno">2</span> <span class="content"> Privacy considerations </span></a>
    <li><a href="#definitions"><span class="secno">3</span> <span class="content">Definitions</span></a>
    <li><a href="#permission-descriptor"><span class="secno">4</span> <span class="content"> Descriptions of permission requests </span></a>
    <li>
     <a href="#permission-operations"><span class="secno">5</span> <span class="content">Permission states</span></a>
     <ol class="toc">
      <li><a href="#reading-current-states"><span class="secno">5.1</span> <span class="content">Reading the current permission state</span></a>
      <li><a href="#requesting-more-permission"><span class="secno">5.2</span> <span class="content">Requesting more permission</span></a>
      <li><a href="#reacting-to-revocation"><span class="secno">5.3</span> <span class="content">Reacting to users revoking permission</span></a>
     </ol>
    <li><a href="#status-of-a-permission"><span class="secno">6</span> <span class="content"> Status of a permission </span></a>
    <li><a href="#navigator-and-workernavigator-extension"><span class="secno">7</span> <span class="content"> Navigator and WorkerNavigator extension </span></a>
    <li><a href="#permissions-interface"><span class="secno">8</span> <span class="content"> Permissions interface </span></a>
    <li><a href="#common-permission-algorithms"><span class="secno">9</span> <span class="content"> Common permission algorithms </span></a>
    <li>
     <a href="#permission-registry"><span class="secno">10</span> <span class="content"> Permission Registry </span></a>
     <ol class="toc">
      <li><a href="#geolocation"><span class="secno">10.1</span> <span class="content"> Geolocation </span></a>
      <li><a href="#notifications"><span class="secno">10.2</span> <span class="content"> Notifications </span></a>
      <li><a href="#push"><span class="secno">10.3</span> <span class="content"> Push </span></a>
      <li><a href="#midi"><span class="secno">10.4</span> <span class="content"> Midi </span></a>
      <li><a href="#media-devices"><span class="secno">10.5</span> <span class="content"> Media Devices </span></a>
      <li><a href="#background-fetch"><span class="secno">10.6</span> <span class="content"> Background Fetch </span></a>
      <li><a href="#background-sync"><span class="secno">10.7</span> <span class="content"> Background Sync </span></a>
      <li><a href="#ambient-light-sensor"><span class="secno">10.8</span> <span class="content"> Ambient Light Sensor </span></a>
      <li><a href="#accelerometer"><span class="secno">10.9</span> <span class="content"> Accelerometer </span></a>
      <li><a href="#gyroscope"><span class="secno">10.10</span> <span class="content"> Gyroscope </span></a>
      <li><a href="#magnetometer"><span class="secno">10.11</span> <span class="content"> Magnetometer </span></a>
      <li><a href="#clipboard"><span class="secno">10.12</span> <span class="content"> Clipboard </span></a>
      <li><a href="#screen-capture"><span class="secno">10.13</span> <span class="content"> Screen Capture </span></a>
      <li><a href="#nfc"><span class="secno">10.14</span> <span class="content"> NFC </span></a>
     </ol>
    <li>
     <a href="#automation"><span class="secno">11</span> <span class="content"> Automation </span></a>
     <ol class="toc">
      <li><a href="#set-permission-command"><span class="secno">11.1</span> <span class="content"> Set Permission </span></a>
     </ol>
    <li><a href="#examples"><span class="secno">12</span> <span class="content"> Examples </span></a>
    <li><a href="#acknowledgments"><span class="secno"></span> <span class="content"> Acknowledgments </span></a>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content">Conformance</span></a>
     <ol class="toc">
      <li><a href="#conventions"><span class="secno"></span> <span class="content">Document conventions</span></a>
      <li><a href="#conformant-algorithms"><span class="secno"></span> <span class="content">Conformant Algorithms</span></a>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <section class="non-normative">
    <h2 class="heading settled" data-level="1" id="scope-of-this-document"><span class="secno">1. </span><span class="content"> Scope of this document </span><a class="self-link" href="#scope-of-this-document"></a></h2>
    <p><em>This section is non-normative.</em></p>
    <p> This document specifies a model for permissions to use powerful features on
    the Web platform and an API to query the current permission state of those
    features. </p>
    <p> Current Web APIs have different ways to deal with permissions. For example,
    the <a data-link-type="biblio" href="#biblio-notifications">[notifications]</a> API allows developers to request a permission and
    check the permission status explicitly. Others expose the status to web
    pages when they try to use the API, like the <a data-link-type="biblio" href="#biblio-geolocation-api">[geolocation-API]</a> which fails
    if the permission was not granted without allowing the developer to check
    beforehand. </p>
    <p> The <code class="idl"><a data-link-type="idl" href="#dom-permissions-query" id="ref-for-dom-permissions-query">query()</a></code> function provides a tool for developers to
    control when permission prompts are shown. </p>
    <p> The solution described in this document is meant to be extensible, but isn’t
    expected to be applicable to all the current and future permissions
    available in the web platform. Working Groups that are creating
    specifications whose permission model doesn’t fit in the model described in
    this document should contact the editors by <a href="https://github.com/w3c/permissions/issues">filing an issue</a>. </p>
   </section>
   <section class="non-normative">
    <h2 class="heading settled" data-level="2" id="privacy-considerations"><span class="secno">2. </span><span class="content"> Privacy considerations </span><a class="self-link" href="#privacy-considerations"></a></h2>
    <p><em>This section is non-normative.</em></p>
    <p> An adversary could use a <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state">permission state</a> as an element in creating a
    "fingerprint" corresponding to an end-user. Although an adversary can
    already determine the state of a permission by actually using the API, that
    often leads to a permission request UI being presented to the end-user (if
    the permission was not already <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted">"granted"</a></code>). Thus, even though this API
    doesn’t expose new fingerprinting information to websites, it makes it
    easier for an adversary to have discreet access to this information. Thus,
    implementations are encouraged to have an option for users to block
    (globally or selectively) the querying of <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①">permission states</a>. </p>
   </section>
   <section>
    <h2 class="heading settled" data-level="3" id="definitions"><span class="secno">3. </span><span class="content">Definitions</span><a class="self-link" href="#definitions"></a></h2>
    <dl>
     <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="new-information-about-the-users-intent">New information about the user’s intent</dfn>
     <dd>
       The UA may collect information about a user’s intentions in any way its
      authors believe is appropriate. This information can come from explicit
      user action, aggregate behavior of both the relevant user and other users,
      or <a data-link-type="dfn" href="#implicit-signals" id="ref-for-implicit-signals">implicit signals</a> this specification hasn’t anticipated. 
      <div class="note" role="note"> The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="implicit-signals">implicit signals</dfn> could be, for example, the <a data-link-type="dfn" href="https://w3c.github.io/manifest/#dfn-install" id="ref-for-dfn-install">install</a> status of a web application or frequency and recency of
        visits. A user that has installed a web application and used it
        frequently and recently is more likely to trust it. Implementations are
        advised to exercise caution when relying on implicit signals. </div>
     <dt><dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-local-lt="feature" id="powerful-feature">Powerful feature</dfn>
     <dd> A feature of a UA that some code might not be allowed to access, for
      example because its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object">environment settings object</a> doesn’t satisfy
      some criteria, or because the user hasn’t given permission. 
    </dl>
   </section>
   <section>
    <h2 class="heading settled" data-level="4" id="permission-descriptor"><span class="secno">4. </span><span class="content"> Descriptions of permission requests </span><a class="self-link" href="#permission-descriptor"></a></h2>
<pre class="idl highlight def" title><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-permissiondescriptor"><code><c- g>PermissionDescriptor</c-></code></dfn> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#enumdef-permissionname" id="ref-for-enumdef-permissionname"><c- n>PermissionName</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionDescriptor" data-dfn-type="dict-member" data-export data-type="PermissionName " id="dom-permissiondescriptor-name"><code><c- g>name</c-></code></dfn>;
};
</pre>
    <p> Each <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature">powerful feature</a> has one or more <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="aspects">aspects</dfn> that
    websites can request permission to access. To describe these aspects,
    each feature defines a subtype of <code class="idl"><a data-link-type="idl" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor">PermissionDescriptor</a></code> to be its <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type">permission descriptor type</a>. </p>
    <div class="example" id="example-descriptors">
     <a class="self-link" href="#example-descriptors"></a> 
     <p> The <code class="idl"><a data-link-type="idl" href="#dom-permissionname-midi" id="ref-for-dom-permissionname-midi">"midi"</a></code> <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature①">feature</a> has two <a data-link-type="dfn" href="#aspects" id="ref-for-aspects">aspects</a>: access to normal messages, and
      access to system exclusive messages. Thus, its <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type①">permission descriptor type</a> is: </p>
<pre>dictionary MidiPermissionDescriptor : PermissionDescriptor {
  boolean sysex = false;
};
</pre>
     <p> The <code class="idl"><a data-link-type="idl" href="https://webbluetoothcg.github.io/web-bluetooth/#dom-permissionname-bluetooth" id="ref-for-dom-permissionname-bluetooth">"bluetooth"</a></code> feature lets sites request to access whatever
      Bluetooth devices are close to to the user’s device. Thus, its <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type②">permission descriptor type</a> is: </p>
<pre>dictionary BluetoothPermissionDescriptor : PermissionDescriptor {
  DOMString deviceId;
  sequence&lt;<a data-link-type="idl" href="https://webbluetoothcg.github.io/web-bluetooth/#dictdef-bluetoothlescanfilterinit" id="ref-for-dictdef-bluetoothlescanfilterinit">BluetoothLEScanFilterInit</a>> filters;
  sequence&lt;<a data-link-type="idl" href="https://webbluetoothcg.github.io/web-bluetooth/#typedefdef-bluetoothserviceuuid" id="ref-for-typedefdef-bluetoothserviceuuid">BluetoothServiceUUID</a>> optionalServices = [];
  boolean acceptAllDevices = false;
};
</pre>
     <p> General access to Bluetooth devices is represented by <code>{name: 'bluetooth'}</code>; access to a particular device is represented by <code>{name: 'bluetooth', deviceId: "id"}</code>; and access to a device with a particular
      service is represented by <code>{name: 'bluetooth', filters: [{services: ['service']}]}</code> </p>
    </div>
   </section>
   <section>
    <h2 class="heading settled" data-level="5" id="permission-operations"><span class="secno">5. </span><span class="content">Permission states</span><a class="self-link" href="#permission-operations"></a></h2>
    <p> The user agent is responsible for tracking what <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature②">powerful features</a> each <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms">realm</a> has the user’s permission to use. Other specifications can
    use the operations defined in this section to retrieve the UA’s notion of
    what permissions are granted or denied, and to ask the user to grant or deny
    more permissions. </p>
    <p> Other specifications can also add more constraints on the UA’s behavior in
    these algorithms. </p>
    <p> Within this section, <var>descriptor</var> is an instance of the <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type③">permission
    descriptor type</a> of the <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature③">powerful feature</a> named by <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name">name</a></code></code>. </p>
    <section>
     <h3 class="heading settled" data-level="5.1" id="reading-current-states"><span class="secno">5.1. </span><span class="content">Reading the current permission state</span><a class="self-link" href="#reading-current-states"></a></h3>
     <div class="algorithm" data-algorithm="permission state">
      <p> A <var>descriptor</var>’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-local-lt="state" id="permission-state">permission state</dfn> for
        an optional <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object①">environment settings object</a> <var>settings</var> is
        the result of the following algorithm, which returns one of <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted①">"granted"</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-prompt" id="ref-for-dom-permissionstate-prompt">"prompt"</a></code>, or <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied">"denied"</a></code>: </p>
      <ol class="algorithm">
       <li> If <var>settings</var> wasn’t passed, set it to the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object">current settings object</a>. 
       <li> If <var>settings</var> is a <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#non-secure-contexts" id="ref-for-non-secure-contexts">non-secure context</a> and <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name①">name</a></code></code> isn’t <a data-link-type="dfn" href="#allowed-in-non-secure-contexts" id="ref-for-allowed-in-non-secure-contexts">allowed in non-secure contexts</a>, then return <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied①">"denied"</a></code>. 
       <li>
         If there exists a <a data-link-type="dfn" href="https://wicg.github.io/feature-policy/#policy-controlled-feature" id="ref-for-policy-controlled-feature">policy-controlled feature</a> identified by <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name②">name</a></code></code> and <var>settings</var> has an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window" id="ref-for-concept-document-window">associated <code>Document</code></a> named <var>document</var>, run the following step: 
        <ol class="algorithm">
         <li> If <var>document</var> is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#allowed-to-use" id="ref-for-allowed-to-use">allowed to use</a> the feature
              identified by <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name③">name</a></code></code> return <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied②">"denied"</a></code>. 
        </ol>
       <li> If there was a previous invocation of this algorithm with the same <var>descriptor</var> and <var>settings</var>, returning <var>previousResult</var>, and the UA has not received <a data-link-type="dfn" href="#new-information-about-the-users-intent" id="ref-for-new-information-about-the-users-intent">new information about
          the user’s intent</a> since that invocation, return <var>previousResult</var>. 
       <li>
         Return whichever of the following options most accurately reflects the user’s
          intent for the calling algorithm, taking into account any <a data-link-type="dfn" href="#permission-state-constraints" id="ref-for-permission-state-constraints">permission state constraints</a> for <code><var>descriptor</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name④">name</a></code></code>: 
        <dl class="switch">
         <dt>succeed without prompting the user
         <dd><code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted②">"granted"</a></code>
         <dt>show the user a prompt to decide whether to succeed
         <dd><code class="idl"><a data-link-type="idl" href="#dom-permissionstate-prompt" id="ref-for-dom-permissionstate-prompt①">"prompt"</a></code>
         <dt>fail without prompting the user
         <dd><code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied③">"denied"</a></code>
        </dl>
      </ol>
      <p class="issue" id="issue-current-entry-incumbent-or-relevant"><a class="self-link" href="#issue-current-entry-incumbent-or-relevant"></a> Safari is the only known UA that returns different results from this
        algorithm for different settings objects with the same origin. We should
        test which of the <a href="https://html.spec.whatwg.org/multipage/webappapis.html#realms-settings-objects-global-objects">several
        possible settings objects</a> it uses. </p>
      <p> As a shorthand, a <code class="idl"><a data-link-type="idl" href="#enumdef-permissionname" id="ref-for-enumdef-permissionname①">PermissionName</a></code> <var>name</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state②">permission state</a> is
        the <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state③">permission state</a> of a <code class="idl"><a data-link-type="idl" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①">PermissionDescriptor</a></code> with its <code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name⑤">name</a></code> member set to <var>name</var>. </p>
     </div>
     <div class="algorithm" data-algorithm="extra permission data">
      <p> Some <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature④">powerful features</a> have more information associated with them
        than just a <code class="idl"><a data-link-type="idl" href="#enumdef-permissionstate" id="ref-for-enumdef-permissionstate">PermissionState</a></code>. For example, <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia" id="ref-for-dom-mediadevices-getusermedia">getUserMedia()</a></code> needs to determine <em>which</em> cameras
        the user has granted the <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#current-realm" id="ref-for-current-realm">current realm</a> permission to access. Each
        of these features defines an <a data-link-type="dfn" href="#extra-permission-data-type" id="ref-for-extra-permission-data-type">extra permission data type</a>. If a <code class="idl"><a data-link-type="idl" href="#enumdef-permissionname" id="ref-for-enumdef-permissionname②">PermissionName</a></code> <var>name</var> names one of these features, then <var>name</var>’s <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="extra-permission-data">extra permission data</dfn> for an optional <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object②">environment
        settings object</a> <var>settings</var> is the result of the following algorithm: </p>
      <ol class="algorithm">
       <li> If <var>settings</var> wasn’t passed, set it to the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object" id="ref-for-current-settings-object①">current settings object</a>. 
       <li> If there was a previous invocation of this algorithm with the same <var>name</var> and <var>settings</var>, returning <var>previousResult</var>, and the UA has not received <a data-link-type="dfn" href="#new-information-about-the-users-intent" id="ref-for-new-information-about-the-users-intent①">new information about
          the user’s intent</a> since that invocation, return <var>previousResult</var>. 
       <li> Return the instance of <var>name</var>’s <a data-link-type="dfn" href="#extra-permission-data-type" id="ref-for-extra-permission-data-type①">extra permission data type</a> that
          matches the UA’s impression of the user’s intent, taking into account
          any <a data-link-type="dfn" href="#extra-permission-data-constraints" id="ref-for-extra-permission-data-constraints">extra permission data constraints</a> for <var>name</var>. 
      </ol>
     </div>
    </section>
    <section>
     <h3 class="heading settled" data-level="5.2" id="requesting-more-permission"><span class="secno">5.2. </span><span class="content">Requesting more permission</span><a class="self-link" href="#requesting-more-permission"></a></h3>
     <p class="note" role="note"> Spec authors, please note that algorithms in this section can wait for
      user input; so they shouldn’t be used from other algorithms running on
      the main thread. </p>
     <div class="algorithm" data-algorithm="request-permission-to-use">
      <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="request permission to use|requesting permission to use" id="request-permission-to-use">request permission to use</dfn> a <var>descriptor</var>, the UA
        must perform the following steps. This algorithm returns either <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted③">"granted"</a></code> or <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied④">"denied"</a></code>. </p>
      <ol>
       <li> Let <var>current state</var> be the <var>descriptor</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state④">permission
          state</a>. 
       <li> If <var>current state</var> is not <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-prompt" id="ref-for-dom-permissionstate-prompt②">"prompt"</a></code>, return <var>current state</var> and abort these steps. 
       <li> Ask the user’s permission for the calling algorithm to use the <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature⑤">powerful feature</a> described by <var>descriptor</var>. 
       <li>
         If the user grants permission, return <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted④">"granted"</a></code>; otherwise return <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied⑤">"denied"</a></code>. The user’s interaction may provide <a data-link-type="dfn" href="#new-information-about-the-users-intent" id="ref-for-new-information-about-the-users-intent②">new information
          about the user’s intent</a> for this <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms①">realm</a> and other <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms②">realms</a> with the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin">same origin</a>. 
        <p class="note" role="note"> This is intentionally vague about the details of the permission UI
            and how the UA infers user intent. UAs should be able to explore
            lots of UI within this framework. </p>
      </ol>
      <p> As a shorthand, <a data-link-type="dfn" href="#request-permission-to-use" id="ref-for-request-permission-to-use">requesting permission to use</a> a <code class="idl"><a data-link-type="idl" href="#enumdef-permissionname" id="ref-for-enumdef-permissionname③">PermissionName</a></code> <var>name</var>, is the same as <a data-link-type="dfn" href="#request-permission-to-use" id="ref-for-request-permission-to-use①">requesting permission to use</a> a <code class="idl"><a data-link-type="idl" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor②">PermissionDescriptor</a></code> with its <code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name⑥">name</a></code> member
        set to <var>name</var>. </p>
     </div>
     <div class="algorithm" data-algorithm="prompt-user-to-choose">
      <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="prompt the user to choose|prompting the user to choose" id="prompt-the-user-to-choose">prompt the user to choose</dfn> one of several <var>options</var> associated with a <var>descriptor</var>, the UA must perform the following steps.
        This algorithm returns either <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied⑥">"denied"</a></code> or one of the options. </p>
      <ol>
       <li> If <var>descriptor</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state⑤">permission state</a> is <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied⑦">"denied"</a></code>,
          return <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied⑧">"denied"</a></code> and abort these steps. 
       <li> If <var>descriptor</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state⑥">permission state</a> is <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted⑤">"granted"</a></code>, the UA may
          return one of <var>options</var> and abort these steps. If the UA returns
          without prompting, then subsequent <a data-link-type="dfn" href="#prompt-the-user-to-choose" id="ref-for-prompt-the-user-to-choose">prompts for the user to choose</a> from the same set of
          options with the same <var>descriptor</var> must return the same option, unless
          the UA receives <a data-link-type="dfn" href="#new-information-about-the-users-intent" id="ref-for-new-information-about-the-users-intent③">new information about the user’s intent</a>. 
       <li> Ask the user to choose one of the options or deny permission, and wait
          for them to choose. If the calling algorithm specified extra
          information to include in the prompt, include it. 
       <li>
         If the user chose an option, return it; otherwise return <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied⑨">"denied"</a></code>.
          If the user’s interaction indicates they intend this choice to apply
          to other realms, then treat this this as <a data-link-type="dfn" href="#new-information-about-the-users-intent" id="ref-for-new-information-about-the-users-intent④">new information about
          the user’s intent</a> for other <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms③">realms</a> with the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin①">same
          origin</a>. 
        <p class="note" role="note"> This is intentionally vague about the details of the permission UI
            and how the UA infers user intent. UAs should be able to explore
            lots of UI within this framework. </p>
      </ol>
      <p> As a shorthand, <a data-link-type="dfn" href="#prompt-the-user-to-choose" id="ref-for-prompt-the-user-to-choose①">prompting the user to choose</a> from options
        associated with a <code class="idl"><a data-link-type="idl" href="#enumdef-permissionname" id="ref-for-enumdef-permissionname④">PermissionName</a></code> <var>name</var>, is the same as <a data-link-type="dfn" href="#prompt-the-user-to-choose" id="ref-for-prompt-the-user-to-choose②">prompting
        the user to choose</a> from those options associated with a <code class="idl"><a data-link-type="idl" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor③">PermissionDescriptor</a></code> with its <code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name⑦">name</a></code> member
        set to <var>name</var>. </p>
     </div>
    </section>
    <section>
     <h3 class="heading settled" data-level="5.3" id="reacting-to-revocation"><span class="secno">5.3. </span><span class="content">Reacting to users revoking permission</span><a class="self-link" href="#reacting-to-revocation"></a></h3>
     <p> When the UA learns that the user no longer intends to grant permission
      for a <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms④">realm</a> to use a <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature⑥">feature</a>, it must <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task">queue a task</a> on the Realm’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-realm-settings-object" id="ref-for-concept-realm-settings-object">settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop">responsible event
      loop</a> to run that feature’s <a data-link-type="dfn" href="#permission-revocation-algorithm" id="ref-for-permission-revocation-algorithm">permission revocation algorithm</a>. </p>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="6" id="status-of-a-permission"><span class="secno">6. </span><span class="content"> Status of a permission </span><a class="self-link" href="#status-of-a-permission"></a></h2>
<pre class="idl highlight def"><c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="enumdef-permissionstate"><code><c- g>PermissionState</c-></code></dfn> {
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted⑥"><c- s>"granted"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied①⓪"><c- s>"denied"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionstate-prompt" id="ref-for-dom-permissionstate-prompt③"><c- s>"prompt"</c-></a>,
};
</pre>
    <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionState" data-dfn-type="enum-value" data-export id="dom-permissionstate-granted"><code>"granted"</code></dfn> state represents
    that the caller will be able
    to successfuly access the feature without having the <a data-link-type="dfn" href="https://www.w3.org/TR/uievents/#user-agent" id="ref-for-user-agent">user agent</a> asking the user’s permission. </p>
    <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionState" data-dfn-type="enum-value" data-export id="dom-permissionstate-denied"><code>"denied"</code></dfn> state represents
    that the caller will not be
    able to access the feature. </p>
    <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionState" data-dfn-type="enum-value" data-export id="dom-permissionstate-prompt"><code>"prompt"</code></dfn> state represents
    that the <a data-link-type="dfn" href="https://www.w3.org/TR/uievents/#user-agent" id="ref-for-user-agent①">user agent</a> will be asking the user’s permission if the caller tries to access the
    feature. The user might grant, deny or dismiss the request. </p>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="permissionstatus"><code><c- g>PermissionStatus</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#enumdef-permissionstate" id="ref-for-enumdef-permissionstate①"><c- n>PermissionState</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="PermissionState" href="#dom-permissionstatus-state" id="ref-for-dom-permissionstatus-state"><c- g>state</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-permissionstatus-onchange" id="ref-for-dom-permissionstatus-onchange"><c- g>onchange</c-></a>;
};
</pre>
    <p> <code class="idl"><a data-link-type="idl" href="#permissionstatus" id="ref-for-permissionstatus">PermissionStatus</a></code> instances are created with a <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionStatus" data-dfn-type="attribute" data-export id="dom-permissionstatus-query-slot"><code>[[query]]</code></dfn> internal slot, which is an
    instance of a feature’s <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type④">permission descriptor type</a>. </p>
    <p> To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="create-a-permissionstatus">create a PermissionStatus</dfn> for a given <code class="idl"><a data-link-type="idl" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor④">PermissionDescriptor</a></code> <var>permissionDesc</var>, return a new instance of the <a data-link-type="dfn" href="#permission-result-type" id="ref-for-permission-result-type">permission result
    type</a> for the feature named by <code><var>permissionDesc</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name⑧">name</a></code></code>,
    with the <code class="idl"><a data-link-type="idl" href="#dom-permissionstatus-query-slot" id="ref-for-dom-permissionstatus-query-slot">[[query]]</a></code> internal slot initialized to <var>permissionDesc</var>. </p>
    <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionStatus" data-dfn-type="attribute" data-export id="dom-permissionstatus-state"><code>state</code></dfn> attribute MUST return the latest value that was set on the current
    instance. </p>
    <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionStatus" data-dfn-type="attribute" data-export id="dom-permissionstatus-onchange"><code>onchange</code></dfn> attribute is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers">event handler</a> whose corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type">event handler event
    type</a> is <code>change</code>. </p>
    <p id="PermissionStatus-update"> Whenever the <a data-link-type="dfn" href="https://www.w3.org/TR/uievents/#user-agent" id="ref-for-user-agent②">user agent</a> is aware that the state of a <code class="idl"><a data-link-type="idl" href="#permissionstatus" id="ref-for-permissionstatus①">PermissionStatus</a></code> instance <var>status</var> has changed,
    it MUST asynchronously run the following steps: </p>
    <ol>
     <li> Run <code><var>status</var>@<code class="idl"><a data-link-type="idl" href="#dom-permissionstatus-query-slot" id="ref-for-dom-permissionstatus-query-slot①">[[query]]</a></code>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name⑨">name</a></code></code>’s <a data-link-type="dfn" href="#permission-query-algorithm" id="ref-for-permission-query-algorithm">permission
      query algorithm</a>, passing <code><var>status</var>@<code class="idl"><a data-link-type="idl" href="#dom-permissionstatus-query-slot" id="ref-for-dom-permissionstatus-query-slot②">[[query]]</a></code></code> and <var>status</var>. 
     <li> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①">Queue a task</a> on the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="permission-task-source">permission task source</dfn> to <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-fire" id="ref-for-concept-event-fire">fire an event</a> named <code>change</code> at <var>status</var>. 
    </ol>
   </section>
   <section>
    <h2 class="heading settled" data-level="7" id="navigator-and-workernavigator-extension"><span class="secno">7. </span><span class="content"> Navigator and WorkerNavigator extension </span><a class="self-link" href="#navigator-and-workernavigator-extension"></a></h2>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=(<c- n>Window</c->)]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator"><c- g>Navigator</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#permissions" id="ref-for-permissions"><c- n>Permissions</c-></a> <dfn class="idl-code" data-dfn-for="Navigator" data-dfn-type="attribute" data-export data-readonly data-type="Permissions" id="dom-navigator-permissions"><code><c- g>permissions</c-></code><a class="self-link" href="#dom-navigator-permissions"></a></dfn>;
};
</pre>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②"><c- g>Exposed</c-></a>=(<c- n>Worker</c->)]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/workers.html#workernavigator" id="ref-for-workernavigator"><c- g>WorkerNavigator</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#permissions" id="ref-for-permissions①"><c- n>Permissions</c-></a> <dfn class="idl-code" data-dfn-for="WorkerNavigator" data-dfn-type="attribute" data-export data-readonly data-type="Permissions" id="dom-workernavigator-permissions"><code><c- g>permissions</c-></code><a class="self-link" href="#dom-workernavigator-permissions"></a></dfn>;
};
</pre>
   </section>
   <section>
    <h2 class="heading settled" data-level="8" id="permissions-interface"><span class="secno">8. </span><span class="content"> Permissions interface </span><a class="self-link" href="#permissions-interface"></a></h2>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="permissions"><code><c- g>Permissions</c-></code></dfn> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#permissionstatus" id="ref-for-permissionstatus②"><c- n>PermissionStatus</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-permissions-query" id="ref-for-dom-permissions-query①"><c- g>query</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object"><c- b>object</c-></a> <dfn class="idl-code" data-dfn-for="Permissions/query(permissionDesc)" data-dfn-type="argument" data-export id="dom-permissions-query-permissiondesc-permissiondesc"><code><c- g>permissionDesc</c-></code><a class="self-link" href="#dom-permissions-query-permissiondesc-permissiondesc"></a></dfn>);
};
</pre>
    <p> When the <dfn class="dfn-paneled idl-code" data-dfn-for="Permissions" data-dfn-type="method" data-export id="dom-permissions-query"><code>query(permissionDesc)</code></dfn> method is
    invoked, the <a data-link-type="dfn" href="https://www.w3.org/TR/uievents/#user-agent" id="ref-for-user-agent③">user agent</a> MUST run the following <dfn data-dfn-type="dfn" data-export data-lt="query a permission" id="query-a-permission">query a
    permission<a class="self-link" href="#query-a-permission"></a></dfn> algorithm, passing the parameter <var>permissionDesc</var>: </p>
    <ol>
     <li>Let <var>rootDesc</var> be the object <var>permissionDesc</var> refers to, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value" id="ref-for-dfn-convert-ecmascript-to-idl-value">converted to
    an IDL value</a> of type <code class="idl"><a data-link-type="idl" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor⑤">PermissionDescriptor</a></code>. If this throws an
    exception, return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with">a promise rejected with</a> that exception and abort
    these steps. 
     <li>Let <var>typedDescriptor</var> be the object <var>permissionDesc</var> refers to, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value" id="ref-for-dfn-convert-ecmascript-to-idl-value①">converted to an IDL value</a> of <code><var>rootDesc</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name①⓪">name</a></code></code>’s <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type⑤">permission
    descriptor type</a>. If this throws an exception, return <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with" id="ref-for-a-promise-rejected-with①">a promise
    rejected with</a> that exception and abort these steps. 
     <li>Let <var>promise</var> be a newly-created <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-promise" id="ref-for-idl-promise">Promise</a></code>. 
     <li>Return <var>promise</var> and continue the following steps
    asynchronously. 
     <li>Run the steps to <a data-link-type="dfn" href="#create-a-permissionstatus" id="ref-for-create-a-permissionstatus">create a PermissionStatus</a> for <var>typedDescriptor</var>,
    and let <var>status</var> be the result. 
     <li> Run <code><var>status</var>@<code class="idl"><a data-link-type="idl" href="#dom-permissionstatus-query-slot" id="ref-for-dom-permissionstatus-query-slot③">[[query]]</a></code>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name①①">name</a></code></code>’s <a data-link-type="dfn" href="#permission-query-algorithm" id="ref-for-permission-query-algorithm①">permission query
      algorithm</a>, passing <code><var>status</var>@<code class="idl"><a data-link-type="idl" href="#dom-permissionstatus-query-slot" id="ref-for-dom-permissionstatus-query-slot④">[[query]]</a></code></code> and <var>status</var>. 
     <li>Resolve <var>promise</var> with <var>status</var>. 
    </ol>
    <div class="note" role="note"> If a developer wants to check multiple permissions at once, the editors
    recommend the use of <code><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-promise" id="ref-for-idl-promise①">Promise</a></code>.all()</code>. An example can be
    found in the <a href="#examples">Examples section</a>. </div>
   </section>
   <section>
    <h2 class="heading settled" data-level="9" id="common-permission-algorithms"><span class="secno">9. </span><span class="content"> Common permission algorithms </span><a class="self-link" href="#common-permission-algorithms"></a></h2>
    <p> The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="boolean-permission-query-algorithm">boolean permission query algorithm</dfn>, given a <code class="idl"><a data-link-type="idl" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor⑥">PermissionDescriptor</a></code> <var>permissionDesc</var> and a <code class="idl"><a data-link-type="idl" href="#permissionstatus" id="ref-for-permissionstatus③">PermissionStatus</a></code> <var>status</var>, runs the following steps: </p>
    <ol class="algorithm">
     <li> Set <code><var>status</var>.state</code> to <var>permissionDesc</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state⑦">permission state</a>. 
    </ol>
   </section>
   <section>
    <h2 class="heading settled" data-level="10" id="permission-registry"><span class="secno">10. </span><span class="content"> Permission Registry </span><a class="self-link" href="#permission-registry"></a></h2>
<pre class="highlight"><c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="enumdef-permissionname"><code><c- g>PermissionName</c-></code></dfn> {
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-geolocation" id="ref-for-dom-permissionname-geolocation"><c- s>"geolocation"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-notifications" id="ref-for-dom-permissionname-notifications"><c- s>"notifications"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-push" id="ref-for-dom-permissionname-push"><c- s>"push"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-midi" id="ref-for-dom-permissionname-midi①"><c- s>"midi"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-camera" id="ref-for-dom-permissionname-camera"><c- s>"camera"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-microphone" id="ref-for-dom-permissionname-microphone"><c- s>"microphone"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-speaker" id="ref-for-dom-permissionname-speaker"><c- s>"speaker"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-device-info" id="ref-for-dom-permissionname-device-info"><c- s>"device-info"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-background-fetch" id="ref-for-dom-permissionname-background-fetch"><c- s>"background-fetch"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-background-sync" id="ref-for-dom-permissionname-background-sync"><c- s>"background-sync"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="https://webbluetoothcg.github.io/web-bluetooth/#dom-permissionname-bluetooth" id="ref-for-dom-permissionname-bluetooth①"><c- s>"bluetooth"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="https://storage.spec.whatwg.org/#dom-permissionname-persistent-storage" id="ref-for-dom-permissionname-persistent-storage"><c- s>"persistent-storage"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-ambient-light-sensor" id="ref-for-dom-permissionname-ambient-light-sensor"><c- s>"ambient-light-sensor"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-accelerometer" id="ref-for-dom-permissionname-accelerometer"><c- s>"accelerometer"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-gyroscope" id="ref-for-dom-permissionname-gyroscope"><c- s>"gyroscope"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-magnetometer" id="ref-for-dom-permissionname-magnetometer"><c- s>"magnetometer"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-clipboard" id="ref-for-dom-permissionname-clipboard"><c- s>"clipboard"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-display-capture" id="ref-for-dom-permissionname-display-capture"><c- s>"display-capture"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-nfc" id="ref-for-dom-permissionname-nfc"><c- s>"nfc"</c-></a>,
};
</pre>
    <p class="note" role="note"> The enumeration values <code class="idl"><a data-link-type="idl" href="#dom-permissionname-accelerometer" id="ref-for-dom-permissionname-accelerometer①">"accelerometer"</a></code>, <code class="idl"><a data-link-type="idl" href="#dom-permissionname-gyroscope" id="ref-for-dom-permissionname-gyroscope①">"gyroscope"</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-permissionname-magnetometer" id="ref-for-dom-permissionname-magnetometer①">"magnetometer"</a></code> are considered provisional and are subject to change
  based on feedback from early implementations. See <a href="https://github.com/w3c/sensors/issues/22">w3c/sensors#22</a> issue
  for more information. </p>
    <p> Each enumeration value in the <code class="idl"><a data-link-type="idl" href="#enumdef-permissionname" id="ref-for-enumdef-permissionname⑤">PermissionName</a></code> enum identifies a <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature⑦">powerful feature</a>. Each <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature⑧">powerful feature</a> has the following
    permission-related flags, algorithms, and types: </p>
    <dl>
     <dt>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="allowed-in-non-secure-contexts">allowed in non-secure contexts</dfn> flag
     <dd> By default, only <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#secure-contexts" id="ref-for-secure-contexts">secure contexts</a> can use <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature⑨">powerful features</a>.
      If this flag is set for a feature, the UA may grant access to it in <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#non-secure-contexts" id="ref-for-non-secure-contexts①">non-secure contexts</a> too. 
     <dt> A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="permission-descriptor-type">permission descriptor type</dfn> 
     <dd>
      <p> <code class="idl"><a data-link-type="idl" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor⑦">PermissionDescriptor</a></code> or one of its subtypes.
        If unspecified, this defaults to <code class="idl"><a data-link-type="idl" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor⑧">PermissionDescriptor</a></code>. </p>
      <p> The feature can define a <a href="https://en.wikipedia.org/wiki/Partially_ordered_set">partial
        order</a> on descriptor instances. If <var>descriptorA</var> is <dfn class="dfn-paneled" data-dfn-for="PermissionDescriptor" data-dfn-type="dfn" data-noexport id="permissiondescriptor-stronger-than">stronger than</dfn> <var>descriptorB</var>, then if <var>descriptorA</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state⑧">permission state</a> is <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted⑦">"granted"</a></code>, <var>descriptorB</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state⑨">permission state</a> must also be <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted⑧">"granted"</a></code>, and
        if <var>descriptorB</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①⓪">permission state</a> is <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied①①">"denied"</a></code>, <var>descriptorA</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①①">permission state</a> must also be <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied①②">"denied"</a></code>. </p>
      <p class="example" id="example-stronger-than"><a class="self-link" href="#example-stronger-than"></a> <code>{name: <code class="idl"><a data-link-type="idl" href="#dom-permissionname-midi" id="ref-for-dom-permissionname-midi②">"midi"</a></code>, sysex: true}</code> ("midi-with-sysex") is <a data-link-type="dfn" href="#permissiondescriptor-stronger-than" id="ref-for-permissiondescriptor-stronger-than">stronger than</a> <code>{name: <code class="idl"><a data-link-type="idl" href="#dom-permissionname-midi" id="ref-for-dom-permissionname-midi③">"midi"</a></code>, sysex: false}</code> ("midi-without-sysex"), so if the user denies access to
        midi-without-sysex, the UA must also deny access to midi-with-sysex, and
        similarly if the user grants access to midi-with-sysex, the UA must also
        grant access to midi-without-sysex. </p>
     <dt>Optional <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="permission-state-constraints">permission state constraints</dfn>
     <dd> Constraints on the values that the UA can return as a descriptor’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①②">permission state</a>. Defaults to no constraints beyond the user’s
      intent. 
     <dt> An optional <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="extra-permission-data-type">extra permission data type</dfn> 
     <dd> If specified, the <a data-link-type="dfn" href="#extra-permission-data" id="ref-for-extra-permission-data">extra permission data</a> algorithm is usable for
      this feature. 
     <dt>Optional <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="extra-permission-data-constraints">extra permission data constraints</dfn>
     <dd> Constraints on the values that the UA can return as a <code class="idl"><a data-link-type="idl" href="#enumdef-permissionname" id="ref-for-enumdef-permissionname⑥">PermissionName</a></code>'s <a data-link-type="dfn" href="#extra-permission-data" id="ref-for-extra-permission-data①">extra permission data</a>. Defaults to no constraints beyond the user’s
      intent. 
     <dt> A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="permission-result-type">permission result type</dfn> 
     <dd> <code class="idl"><a data-link-type="idl" href="#permissionstatus" id="ref-for-permissionstatus④">PermissionStatus</a></code> or one of its subtypes.
      If unspecified, this defaults to <code class="idl"><a data-link-type="idl" href="#permissionstatus" id="ref-for-permissionstatus⑤">PermissionStatus</a></code>. 
     <dt> A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="permission-query-algorithm">permission query algorithm</dfn> 
     <dd> Takes an instance of the <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type⑥">permission descriptor type</a> and a new or
      existing instance of the <a data-link-type="dfn" href="#permission-result-type" id="ref-for-permission-result-type①">permission result type</a>, and updates the <a data-link-type="dfn" href="#permission-result-type" id="ref-for-permission-result-type②">permission result type</a> instance with the query result. Used by <code class="idl"><a data-link-type="idl" href="#permissions" id="ref-for-permissions②">Permissions</a></code>' <code class="idl"><a data-link-type="idl" href="#dom-permissions-query" id="ref-for-dom-permissions-query②">query(permissionDesc)</a></code> method and the <a href="#PermissionStatus-update">PermissionStatus update steps</a>. If
      unspecified, this defaults to the <a data-link-type="dfn" href="#boolean-permission-query-algorithm" id="ref-for-boolean-permission-query-algorithm">boolean permission query
      algorithm</a>. 
     <dt> A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="permission-revocation-algorithm">permission revocation algorithm</dfn> 
     <dd> Takes no arguments. Updates any other parts of the implementation that
      need to be kept in sync with changes in the results of <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①③">permission
      states</a> or <a data-link-type="dfn" href="#extra-permission-data" id="ref-for-extra-permission-data②">extra permission data</a>. Run by <a href="#reacting-to-revocation">§ 5.3 Reacting to users revoking permission</a>.
      If unspecified, this defaults to doing nothing. 
    </dl>
    <p> A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="boolean-feature">boolean feature</dfn> is a <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature①⓪">powerful feature</a> with all
    of the above types and algorithms defaulted. </p>
    <section>
     <h3 class="heading settled" data-level="10.1" id="geolocation"><span class="secno">10.1. </span><span class="content"> Geolocation </span><a class="self-link" href="#geolocation"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-geolocation"><code>"geolocation"</code></dfn> permission is the permission associated with the usage of the <a data-link-type="biblio" href="#biblio-geolocation-api">[geolocation-API]</a>. It is a <a data-link-type="dfn" href="#boolean-feature" id="ref-for-boolean-feature">boolean feature</a> and is <a data-link-type="dfn" href="#allowed-in-non-secure-contexts" id="ref-for-allowed-in-non-secure-contexts①">allowed in
      non-secure contexts</a>. </p>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.2" id="notifications"><span class="secno">10.2. </span><span class="content"> Notifications </span><a class="self-link" href="#notifications"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-notifications"><code>"notifications"</code></dfn> permission is the permission associated with the usage of the <a data-link-type="biblio" href="#biblio-notifications">[notifications]</a> API. It is a <a data-link-type="dfn" href="#boolean-feature" id="ref-for-boolean-feature①">boolean feature</a> and is <a data-link-type="dfn" href="#allowed-in-non-secure-contexts" id="ref-for-allowed-in-non-secure-contexts②">allowed in
      non-secure contexts</a>. </p>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.3" id="push"><span class="secno">10.3. </span><span class="content"> Push </span><a class="self-link" href="#push"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-push"><code>"push"</code></dfn> permission is the permission associated with the usage of the <a data-link-type="biblio" href="#biblio-push-api">[push-api]</a>. </p>
     <dl>
      <dt> <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type⑦">permission descriptor type</a> 
      <dd>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="idl-code" data-dfn-type="dictionary" data-export id="dictdef-pushpermissiondescriptor"><code><c- g>PushPermissionDescriptor</c-></code><a class="self-link" href="#dictdef-pushpermissiondescriptor"></a></dfn> : <a class="n" data-link-type="idl-name" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor⑨"><c- n>PermissionDescriptor</c-></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a> <dfn class="idl-code" data-default="false" data-dfn-for="PushPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-pushpermissiondescriptor-uservisibleonly"><code><c- g>userVisibleOnly</c-></code><a class="self-link" href="#dom-pushpermissiondescriptor-uservisibleonly"></a></dfn> = <c- b>false</c->;
};
</pre>
       <p> <code>{name: "push", userVisibleOnly: false}</code> is <a data-link-type="dfn" href="#permissiondescriptor-stronger-than" id="ref-for-permissiondescriptor-stronger-than①">stronger than</a> <code>{name: "push", userVisibleOnly: true}</code>. </p>
     </dl>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.4" id="midi"><span class="secno">10.4. </span><span class="content"> Midi </span><a class="self-link" href="#midi"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-midi"><code>"midi"</code></dfn> permission is the permission associated with the usage of <a data-link-type="biblio" href="#biblio-webmidi">[webmidi]</a>. <code class="idl"><a data-link-type="idl" href="#dom-permissionname-midi" id="ref-for-dom-permissionname-midi④">"midi"</a></code> is <a data-link-type="dfn" href="#allowed-in-non-secure-contexts" id="ref-for-allowed-in-non-secure-contexts③">allowed in non-secure contexts</a>. </p>
     <dl>
      <dt> <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type⑧">permission descriptor type</a> 
      <dd>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="idl-code" data-dfn-type="dictionary" data-export id="dictdef-midipermissiondescriptor"><code><c- g>MidiPermissionDescriptor</c-></code><a class="self-link" href="#dictdef-midipermissiondescriptor"></a></dfn> : <a class="n" data-link-type="idl-name" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①⓪"><c- n>PermissionDescriptor</c-></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①"><c- b>boolean</c-></a> <dfn class="idl-code" data-default="false" data-dfn-for="MidiPermissionDescriptor" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-midipermissiondescriptor-sysex"><code><c- g>sysex</c-></code><a class="self-link" href="#dom-midipermissiondescriptor-sysex"></a></dfn> = <c- b>false</c->;
};
</pre>
       <p> <code>{name: "midi", sysex: true}</code> is <a data-link-type="dfn" href="#permissiondescriptor-stronger-than" id="ref-for-permissiondescriptor-stronger-than②">stronger than</a> <code>{name: "midi", sysex: false}</code>. </p>
     </dl>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.5" id="media-devices"><span class="secno">10.5. </span><span class="content"> Media Devices </span><a class="self-link" href="#media-devices"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-camera"><code>"camera"</code></dfn>, <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-microphone"><code>"microphone"</code></dfn> , and <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-speaker"><code>"speaker"</code></dfn> permissions are associated with permission to use media devices as
      specified in <a data-link-type="biblio" href="#biblio-getusermedia">[GETUSERMEDIA]</a> and <a data-link-type="biblio" href="#biblio-audio-output">[audio-output]</a>. <code class="idl"><a data-link-type="idl" href="#dom-permissionname-speaker" id="ref-for-dom-permissionname-speaker①">"speaker"</a></code> is <a data-link-type="dfn" href="#allowed-in-non-secure-contexts" id="ref-for-allowed-in-non-secure-contexts④">allowed in non-secure contexts</a>. <code class="idl"><a data-link-type="idl" href="#dom-permissionname-camera" id="ref-for-dom-permissionname-camera①">"camera"</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-permissionname-microphone" id="ref-for-dom-permissionname-microphone①">"microphone"</a></code> MAY be <a data-link-type="dfn" href="#allowed-in-non-secure-contexts" id="ref-for-allowed-in-non-secure-contexts⑤">allowed in non-secure contexts</a>. </p>
     <dl>
      <dt> <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type⑨">permission descriptor type</a> 
      <dd>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="idl-code" data-dfn-type="dictionary" data-export id="dictdef-devicepermissiondescriptor"><code><c- g>DevicePermissionDescriptor</c-></code><a class="self-link" href="#dictdef-devicepermissiondescriptor"></a></dfn> : <a class="n" data-link-type="idl-name" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①①"><c- n>PermissionDescriptor</c-></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="DevicePermissionDescriptor" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-devicepermissiondescriptor-deviceid"><code><c- g>deviceId</c-></code></dfn>;
};
</pre>
       <p> A permission covers access to the device given in the associated
          descriptor. </p>
       <p> If the descriptor does not have a <code class="idl"><a data-link-type="idl" href="#dom-devicepermissiondescriptor-deviceid" id="ref-for-dom-devicepermissiondescriptor-deviceid">deviceId</a></code>, its semantic is that it
          queries for access to all devices of that class. Thus, if a query for
          the <code class="idl"><a data-link-type="idl" href="#dom-permissionname-camera" id="ref-for-dom-permissionname-camera②">"camera"</a></code> permission with no <code class="idl"><a data-link-type="idl" href="#dom-devicepermissiondescriptor-deviceid" id="ref-for-dom-devicepermissiondescriptor-deviceid①">deviceId</a></code> returns <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted⑨">"granted"</a></code>, the
          client knows that there will never be a permission prompt for a
          camera, and if <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied①③">"denied"</a></code> is returned, it knows that no getUserMedia
          request for a camera will succeed. </p>
       <p> If a permission state is present for access to some, but not all,
          cameras, a query without the <code class="idl"><a data-link-type="idl" href="#dom-devicepermissiondescriptor-deviceid" id="ref-for-dom-devicepermissiondescriptor-deviceid②">deviceId</a></code> will return <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-prompt" id="ref-for-dom-permissionstate-prompt④">"prompt"</a></code>. </p>
       <p> Note that a "granted" permission is no guarantee that getUserMedia
          will succeed. It only guarantees that the user will not be
          prompted for permission. There are many other things (such as
          constraints or the camera being in use) that can cause getUserMedia
          to fail. </p>
      <dt> <a data-link-type="dfn" href="#extra-permission-data-type" id="ref-for-extra-permission-data-type②">extra permission data type</a> 
      <dd> A list of <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/mediacapture-main/#deviceid" id="ref-for-deviceid">deviceId</a></code> values for the devices the user
        has made a non-default decision on access to. 
      <dt> <a data-link-type="dfn" href="#permission-query-algorithm" id="ref-for-permission-query-algorithm②">permission query algorithm</a> 
      <dd>
        The permission query algorithm runs the following steps: 
       <ol class="algorithm">
        <li> If <var>permissionDesc</var>.deviceId exists in the <a data-link-type="dfn" href="#extra-permission-data" id="ref-for-extra-permission-data③">extra permission data</a>,
        set <code><var>status</var>.state</code> to <var>permissionDesc</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①④">permission state</a> and terminate these
        steps. 
        <li>Let <var>global</var> be a copy of <var>permissionDesc</var> with the <code class="idl"><a data-link-type="idl" href="#dom-devicepermissiondescriptor-deviceid" id="ref-for-dom-devicepermissiondescriptor-deviceid③">deviceId</a></code> member removed. 
        <li> Set <code><var>status</var>.state</code> to <var>global</var>’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①⑤">permission state</a>. 
       </ol>
      <dt> <a data-link-type="dfn" href="https://wicg.github.io/permissions-request/#permission-request-algorithm" id="ref-for-permission-request-algorithm">permission request algorithm</a> 
      <dd>
        The permission request algorithm runs the following steps: 
       <ol class="algorithm">
        <li> Let <var>result</var> be the result of running the <a data-link-type="dfn" href="https://wicg.github.io/permissions-request/#boolean-permission-request-algorithm" id="ref-for-boolean-permission-request-algorithm">boolean permission
        request algorithm</a>. 
        <li>If <var>result</var> is <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted①⓪">"granted"</a></code>, the UA MUST set the <code class="idl"><a data-link-type="idl" href="#dom-permissionname-device-info" id="ref-for-dom-permissionname-device-info①">"device-info"</a></code> permission to <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted①①">"granted"</a></code> for this <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms⑤">realm</a>. 
        <li>The UA MAY treat <var>result</var> as <a data-link-type="dfn" href="#new-information-about-the-users-intent" id="ref-for-new-information-about-the-users-intent⑤">new information about the
        user’s intent</a> with respect to the <code class="idl"><a data-link-type="idl" href="#dom-permissionname-device-info" id="ref-for-dom-permissionname-device-info②">"device-info"</a></code> permission for
        this <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms⑥">realm</a> and other <a data-link-type="dfn" href="https://tc39.github.io/ecma262/#sec-code-realms" id="ref-for-sec-code-realms⑦">realms</a> with the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin②">same origin</a>,
        provided it doesn’t violate the previous step. 
        <li>Return <var>result</var>. 
       </ol>
      <dt> <a data-link-type="dfn" href="#permission-revocation-algorithm" id="ref-for-permission-revocation-algorithm①">permission revocation algorithm</a> 
      <dd> When permission for a device is revoked, the UA MUST run the
        algorithm to stop the track for any other reason than the stop()
        method being invoked for each MediaStreamTrack sourced from that
        device. 
     </dl>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-device-info"><code>"device-info"</code></dfn> permission controls access to the name and capabilities associated with a <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/mediacapture-main/#deviceid" id="ref-for-deviceid①">deviceId</a></code>, as well as whether <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/mediacapture-main/#devicechange" id="ref-for-devicechange">devicechange</a></code> events fire when the current browsing
      context is not in focus. The <code class="idl"><a data-link-type="idl" href="#dom-permissionname-device-info" id="ref-for-dom-permissionname-device-info③">"device-info"</a></code> permission MUST be revoked
      when <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/mediacapture-main/#deviceid" id="ref-for-deviceid②">deviceId</a></code>s for an origin are reset. </p>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.6" id="background-fetch"><span class="secno">10.6. </span><span class="content"> Background Fetch </span><a class="self-link" href="#background-fetch"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-background-fetch"><code>"background-fetch"</code></dfn> permission is the permission associated with the usage of <a data-link-type="biblio" href="#biblio-background-fetch">[background-fetch]</a>. </p>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.7" id="background-sync"><span class="secno">10.7. </span><span class="content"> Background Sync </span><a class="self-link" href="#background-sync"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-background-sync"><code>"background-sync"</code></dfn> permission is the permission associated with the usage of <a data-link-type="biblio" href="#biblio-web-background-sync">[web-background-sync]</a>. </p>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.8" id="ambient-light-sensor"><span class="secno">10.8. </span><span class="content"> Ambient Light Sensor </span><a class="self-link" href="#ambient-light-sensor"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-ambient-light-sensor"><code>"ambient-light-sensor"</code></dfn> permission is the permission associated with the usage of the <a data-link-type="biblio" href="#biblio-ambient-light">[ambient-light]</a> API. </p>
     <p>Its <a data-link-type="dfn" href="#permission-revocation-algorithm" id="ref-for-permission-revocation-algorithm②">permission revocation algorithm</a> is the result of calling <a data-link-type="dfn" href="https://w3c.github.io/sensors/#generic-sensor-permission-revocation-algorithm" id="ref-for-generic-sensor-permission-revocation-algorithm">generic sensor permission revocation algorithm</a> passing it <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-ambient-light-sensor" id="ref-for-dom-permissionname-ambient-light-sensor①">"ambient-light-sensor"</a> as argument.</p>
     <p></p>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.9" id="accelerometer"><span class="secno">10.9. </span><span class="content"> Accelerometer </span><a class="self-link" href="#accelerometer"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-accelerometer"><code>"accelerometer"</code></dfn> permission is the permission associated with the usage of the <a data-link-type="biblio" href="#biblio-accelerometer">[accelerometer]</a> API. </p>
     <p>Its <a data-link-type="dfn" href="#permission-revocation-algorithm" id="ref-for-permission-revocation-algorithm③">permission revocation algorithm</a> is the result of calling <a data-link-type="dfn" href="https://w3c.github.io/sensors/#generic-sensor-permission-revocation-algorithm" id="ref-for-generic-sensor-permission-revocation-algorithm①">generic sensor permission revocation algorithm</a> passing it <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-accelerometer" id="ref-for-dom-permissionname-accelerometer②">"accelerometer"</a> as argument.</p>
     <p></p>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.10" id="gyroscope"><span class="secno">10.10. </span><span class="content"> Gyroscope </span><a class="self-link" href="#gyroscope"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-gyroscope"><code>"gyroscope"</code></dfn> permission is the permission associated with the usage of the <a data-link-type="biblio" href="#biblio-gyroscope">[gyroscope]</a> API. </p>
     <p>Its <a data-link-type="dfn" href="#permission-revocation-algorithm" id="ref-for-permission-revocation-algorithm④">permission revocation algorithm</a> is the result of calling <a data-link-type="dfn" href="https://w3c.github.io/sensors/#generic-sensor-permission-revocation-algorithm" id="ref-for-generic-sensor-permission-revocation-algorithm②">generic sensor permission revocation algorithm</a> passing it <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-gyroscope" id="ref-for-dom-permissionname-gyroscope②">"gyroscope"</a> as argument.</p>
     <p></p>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.11" id="magnetometer"><span class="secno">10.11. </span><span class="content"> Magnetometer </span><a class="self-link" href="#magnetometer"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-magnetometer"><code>"magnetometer"</code></dfn> permission is the permission associated with the usage of the <a data-link-type="biblio" href="#biblio-magnetometer">[magnetometer]</a> API. </p>
     <p>Its <a data-link-type="dfn" href="#permission-revocation-algorithm" id="ref-for-permission-revocation-algorithm⑤">permission revocation algorithm</a> is the result of calling <a data-link-type="dfn" href="https://w3c.github.io/sensors/#generic-sensor-permission-revocation-algorithm" id="ref-for-generic-sensor-permission-revocation-algorithm③">generic sensor permission revocation algorithm</a> passing it <a class="idl-code" data-link-type="enum-value" href="#dom-permissionname-magnetometer" id="ref-for-dom-permissionname-magnetometer②">"magnetometer"</a> as argument.</p>
     <p></p>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.12" id="clipboard"><span class="secno">10.12. </span><span class="content"> Clipboard </span><a class="self-link" href="#clipboard"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-clipboard"><code>"clipboard"</code></dfn> permission is the permission associated with the usage of the
      asynchronous methods in the <a data-link-type="biblio" href="#biblio-clipboard-apis">[clipboard-apis]</a>. </p>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.13" id="screen-capture"><span class="secno">10.13. </span><span class="content"> Screen Capture </span><a class="self-link" href="#screen-capture"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-display-capture"><code>"display-capture"</code></dfn> permission is the permission associated with the usage of <a data-link-type="biblio" href="#biblio-screen-capture">[screen-capture]</a>. </p>
     <dl>
      <dt> <a data-link-type="dfn" href="#permission-state-constraints" id="ref-for-permission-state-constraints①">permission state constraints</a> 
      <dd> Valid values for this descriptor’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①⑥">permission state</a> are <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-prompt" id="ref-for-dom-permissionstate-prompt⑤">"prompt"</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied①④">"denied"</a></code>. The user agent MUST NOT ever set this
        descriptor’s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①⑦">permission state</a> to <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted①②">"granted"</a></code>. 
     </dl>
    </section>
    <section>
     <h3 class="heading settled" data-level="10.14" id="nfc"><span class="secno">10.14. </span><span class="content"> NFC </span><a class="self-link" href="#nfc"></a></h3>
     <p> The <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionName" data-dfn-type="enum-value" data-export id="dom-permissionname-nfc"><code>"nfc"</code></dfn> permission is the permission associated with the usage of the <a data-link-type="biblio" href="#biblio-web-nfc">[web-nfc]</a> API. </p>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="11" id="automation"><span class="secno">11. </span><span class="content"> Automation </span><a class="self-link" href="#automation"></a></h2>
    <p> For the purposes of user-agent automation and application testing, this
    document defines the following <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-commands" id="ref-for-dfn-extension-commands">extension command</a> for the <a data-link-type="biblio" href="#biblio-webdriver">[WebDriver]</a> specification. </p>
<pre class="idl highlight def"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-permissionsetparameters"><code><c- g>PermissionSetParameters</c-></code></dfn> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①②"><c- n>PermissionDescriptor</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionSetParameters" data-dfn-type="dict-member" data-export data-type="PermissionDescriptor " id="dom-permissionsetparameters-descriptor"><code><c- g>descriptor</c-></code></dfn>;
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#enumdef-permissionstate" id="ref-for-enumdef-permissionstate②"><c- n>PermissionState</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="PermissionSetParameters" data-dfn-type="dict-member" data-export data-type="PermissionState " id="dom-permissionsetparameters-state"><code><c- g>state</c-></code></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="PermissionSetParameters" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-permissionsetparameters-onerealm"><code><c- g>oneRealm</c-></code></dfn> = <c- b>false</c->;
};
</pre>
    <section>
     <h3 class="heading settled" data-level="11.1" id="set-permission-command"><span class="secno">11.1. </span><span class="content"> Set Permission </span><a class="self-link" href="#set-permission-command"></a></h3>
     <table>
      <tbody>
       <tr>
        <th>HTTP Method
        <th><a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-command-uri-template" id="ref-for-dfn-extension-command-uri-template">URI Template</a>
       <tr>
        <td>POST
        <td>/session/{session id}/permissions
     </table>
     <p>The <dfn data-dfn-type="dfn" data-noexport id="set-permission">Set Permission<a class="self-link" href="#set-permission"></a></dfn> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-commands" id="ref-for-dfn-extension-commands①">extension command</a> simulates user
    modification of a <code class="idl"><a data-link-type="idl" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①③">PermissionDescriptor</a></code>'s <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①⑧">permission state</a>.</p>
     <p>The <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-remote-end-steps" id="ref-for-dfn-remote-end-steps">remote end steps</a> are:</p>
     <ol>
      <li>Let <var>parameters</var> be the <var>parameters</var> argument, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value" id="ref-for-dfn-convert-ecmascript-to-idl-value②">converted to an IDL
        value</a> of type <code class="idl"><a data-link-type="idl" href="#dictdef-permissionsetparameters" id="ref-for-dictdef-permissionsetparameters">PermissionSetParameters</a></code>. If this throws an
        exception, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error" id="ref-for-dfn-error">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code" id="ref-for-dfn-error-code">WebDriver error
        code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-invalid-argument" id="ref-for-dfn-invalid-argument">invalid argument</a>. 
      <li>Let <var>rootDesc</var> be <var>parameters</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissionsetparameters-descriptor" id="ref-for-dom-permissionsetparameters-descriptor">descriptor</a></code>.
      <li>Let <var>typedDescriptor</var> be the object <var>rootDesc</var> refers to, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value" id="ref-for-dfn-convert-ecmascript-to-idl-value③">converted to an IDL value</a> of <code><var>rootDesc</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name①②">name</a></code></code>’s <a data-link-type="dfn" href="#permission-descriptor-type" id="ref-for-permission-descriptor-type①⓪">permission
        descriptor type</a>. If this throws an exception, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error" id="ref-for-dfn-error①">WebDriver
        error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code" id="ref-for-dfn-error-code①">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-invalid-argument" id="ref-for-dfn-invalid-argument①">invalid
        argument</a>.
      <li>
       If <var>parameters</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissionsetparameters-state" id="ref-for-dom-permissionsetparameters-state">state</a></code> is an inappropriate <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state①⑨">permission state</a> for any implementation-defined reason, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error" id="ref-for-dfn-error②">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code" id="ref-for-dfn-error-code②">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-invalid-argument" id="ref-for-dfn-invalid-argument②">invalid
        argument</a>. 
       <p class="note" role="note"> For example, <a data-link-type="dfn" href="https://www.w3.org/TR/uievents/#user-agent" id="ref-for-user-agent④">user agents</a> that define the <code class="idl"><a data-link-type="idl" href="#dom-permissionname-midi" id="ref-for-dom-permissionname-midi⑤">"midi"</a></code> <a data-link-type="dfn" href="#powerful-feature" id="ref-for-powerful-feature①①">feature</a> as "always on" may choose to reject command
          to set the <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state②⓪">permission state</a> to <code class="idl"><a data-link-type="idl" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied①⑤">"denied"</a></code> at this step. </p>
      <li>Let <var>settings</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object③">environment settings object</a> of the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context">current browsing context</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document">active document</a>.
      <li>If <var>settings</var> is a <a data-link-type="dfn" href="https://w3c.github.io/webappsec-secure-contexts/#non-secure-contexts" id="ref-for-non-secure-contexts②">non-secure context</a> and <code><var>rootDesc</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissiondescriptor-name" id="ref-for-dom-permissiondescriptor-name①③">name</a></code></code> isn’t <a data-link-type="dfn" href="#allowed-in-non-secure-contexts" id="ref-for-allowed-in-non-secure-contexts⑥">allowed
        in non-secure contexts</a>, return a <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error" id="ref-for-dfn-error③">WebDriver error</a> with <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code" id="ref-for-dfn-error-code③">WebDriver error code</a> <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-invalid-argument" id="ref-for-dfn-invalid-argument③">invalid argument</a>.
      <li>If <var>parameters</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissionsetparameters-onerealm" id="ref-for-dom-permissionsetparameters-onerealm">oneRealm</a></code> is true, let <var>targets</var> be a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list">list</a> whose sole member is <var>settings</var>.
      <li>Otherwise, let <var>targets</var> be a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①">list</a> containing all <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object④">environment settings objects</a> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin" id="ref-for-concept-settings-object-origin">origin</a> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin③">same</a> as the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin" id="ref-for-concept-settings-object-origin①">origin</a> of <var>settings</var>.
      <li>Let <var>tasks</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list②">list</a>. 
      <li>
        For each <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object⑤">environment settings object</a> <var>target</var> in <var>targets</var>: 
       <ol>
        <li><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②">Queue a task</a> <var>task</var> on the <a data-link-type="dfn" href="#permission-task-source" id="ref-for-permission-task-source">permission task source</a> of <var>target</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context" id="ref-for-responsible-browsing-context">responsible browsing
            context</a> to perform the following step:
        <ol>
         <li>Interpret <var>parameters</var>.<code class="idl"><a data-link-type="idl" href="#dom-permissionsetparameters-state" id="ref-for-dom-permissionsetparameters-state①">state</a></code> as if
              it were the result of an invocation of <a data-link-type="dfn" href="#permission-state" id="ref-for-permission-state②①">permission state</a> for <var>typedDescriptor</var> with the argument <var>target</var> made at this
              moment.
        </ol>
        <li><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append">Append</a> <var>task</var> to <var>tasks</var>.
       </ol>
      <li>Wait for all <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task">tasks</a> in <var>tasks</var> to have executed.
      <li>Return <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-success" id="ref-for-dfn-success">success</a> with data <code>null</code>.
     </ol>
     <div class="example" id="example-4345ddfe">
      <a class="self-link" href="#example-4345ddfe"></a> To set permission for <code>{name: <code class="idl"><a data-link-type="idl" href="#dom-permissionname-midi" id="ref-for-dom-permissionname-midi⑥">"midi"</a></code>, sysex: true}</code> of the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-current-browsing-context" id="ref-for-dfn-current-browsing-context①">current browsing context</a> of the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-session" id="ref-for-dfn-session">session</a> with ID 23 to
      "<code>granted</code>", the <a data-link-type="dfn" href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-local-end" id="ref-for-dfn-local-end">local end</a> would POST to <code>/session/23/permissions</code> with the body: 
<pre class="lang-json highlight"><c- p>{</c->
  <c- f>"descriptor"</c-><c- p>:</c-> <c- p>{</c->
    <c- f>"name"</c-><c- p>:</c-> <c- u>"midi"</c-><c- p>,</c->
    <c- f>"sysex"</c-><c- p>:</c-> <c- kc>true</c->
  <c- p>},</c->
  <c- f>"state"</c-><c- p>:</c-> <c- u>"granted"</c->
<c- p>}</c->
</pre>
     </div>
    </section>
   </section>
   <section class="non-normative">
    <h2 class="heading settled" data-level="12" id="examples"><span class="secno">12. </span><span class="content"> Examples </span><a class="self-link" href="#examples"></a></h2>
    <div class="example" id="example-geolocation">
     <a class="self-link" href="#example-geolocation"></a> 
     <p> This example uses the Permissions API to decide whether local news
    should be shown using the Geolocation API or with a button offering to
    add the feature. </p>
<pre class="highlight">navigator.permissions.query({ name: "geolocation" }).then(({ state }) => {
  switch (state) {
    case "granted":
      showLocalNewsWithGeolocation();
      break;
    case "prompt":
      showButtonToEnableLocalNews();
      break;
    default:
      // Don’t do anything if the permission was denied.
      break;
  }
});
</pre>
    </div>
    <div class="example" id="example-notifications">
     <a class="self-link" href="#example-notifications"></a> 
     <p> This example is using the <code class="idl"><a data-link-type="idl" href="#dom-permissionname-notifications" id="ref-for-dom-permissionname-notifications①">"notifications"</a></code> permission for a
    chat application to show a notification button depending on the
    permission state. </p>
<pre class="highlight">function updateNotificationButton(state) {
  document.getElementById('chat-notification-button')
    .disabled = (state === 'denied');
}

navigator.permissions.query({ name: 'notifications' }).then((result) => {
  updateNotificationButton(result.state);
  result.addEventListener('change', () => {
    updateNotificationButton(result.state);
  });
});
</pre>
    </div>
    <div class="example" id="example-two-permissions">
     <a class="self-link" href="#example-two-permissions"></a> 
     <p> This example is checking whether the page has the <code class="idl"><a data-link-type="idl" href="#dom-permissionname-geolocation" id="ref-for-dom-permissionname-geolocation①">"geolocation"</a></code> and the <code class="idl"><a data-link-type="idl" href="#dom-permissionname-notifications" id="ref-for-dom-permissionname-notifications②">"notifications"</a></code> permissions
    using <code><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-promise" id="ref-for-idl-promise②">Promise</a></code>.all</code>. </p>
<pre class="highlight">Promise.all([
  navigator.permissions.query({ name: "geolocation" }),
  navigator.permissions.query({ name: "notifications" })
])
.then(([{ state: geoState }, { state: notifState }]) => {
  console.log("Geolocation permission state is:", geoState);
  console.log("Notifications permission state is:", notifState);
});
</pre>
    </div>
    <div class="example" id="example-deviceId">
     <a class="self-link" href="#example-deviceId"></a> 
     <p> This example is checking the permission state of the available cameras. </p>
<pre class="highlight">navigator.mediaDevices
  .enumerateDevices()
  .then(devices => {
    return Promise.all(devices
      // filter on video inputs
      .filter(({ kind }) => kind === "videoinput")
      // map to query object
      .map(({ deviceId }) => ({ name: "camera", deviceId }))
      // map to query promise
      .map(queryObj => navigator.permissions.query(queryObj))
    );
  })
  // log the state or each camera
  .then(results => results.forEach(
    ({ state }, i) => console.log(<code>Camera ${i}: "${state}"</code>)
  ))
  .catch(
    err => console.error(err.stack)
  );
</pre>
    </div>
   </section>
   <section class="non-normative">
    <h2 class="no-num heading settled" id="acknowledgments"><span class="content"> Acknowledgments </span><a class="self-link" href="#acknowledgments"></a></h2>
    <p> The editors would like to thank Adrienne Porter Felt, Anne van
    Kesteren, Domenic Denicola, Jake Archibald and Wendy Seltzer for their
    help with the API design and editorial work. </p>
   </section>
  </main>
  <h2 class="no-ref no-num heading settled" id="conformance"><span class="content">Conformance</span><a class="self-link" href="#conformance"></a></h2>
  <h3 class="no-ref no-num heading settled" id="conventions"><span class="content">Document conventions</span><a class="self-link" href="#conventions"></a></h3>
  <p>Conformance requirements are expressed with a combination of
    descriptive assertions and RFC 2119 terminology. The key words “MUST”,
    “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
    “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
    document are to be interpreted as described in RFC 2119.
    However, for readability, these words do not appear in all uppercase
    letters in this specification. </p>
  <p>All of the text of this specification is normative except sections
    explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a></p>
  <p>Examples in this specification are introduced with the words “for example”
    or are set apart from the normative text with <code>class="example"</code>,
    like this: </p>
  <div class="example" id="example-ae2b6bc0">
   <a class="self-link" href="#example-ae2b6bc0"></a> 
   <p>This is an example of an informative example.</p>
  </div>
  <p>Informative notes begin with the word “Note” and are set apart from the
    normative text with <code>class="note"</code>, like this: </p>
  <p class="note" role="note">Note, this is an informative note.</p>
  <h3 class="no-ref no-num heading settled" id="conformant-algorithms"><span class="content">Conformant Algorithms</span><a class="self-link" href="#conformant-algorithms"></a></h3>
  <p>Requirements phrased in the imperative as part of algorithms (such as
    "strip any leading space characters" or "return false and abort these
    steps") are to be interpreted with the meaning of the key word ("must",
    "should", "may", etc) used in introducing the algorithm.</p>
  <p>Conformance requirements phrased as algorithms or specific steps can be
    implemented in any manner, so long as the end result is equivalent. In
    particular, the algorithms defined in this specification are intended to
    be easy to understand and are not intended to be performant. Implementers
    are encouraged to optimize.</p>
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#dom-permissionname-accelerometer">"accelerometer"</a><span>, in §10.9</span>
   <li><a href="#allowed-in-non-secure-contexts">allowed in non-secure contexts</a><span>, in §10</span>
   <li><a href="#dom-permissionname-ambient-light-sensor">"ambient-light-sensor"</a><span>, in §10.8</span>
   <li><a href="#aspects">aspects</a><span>, in §4</span>
   <li><a href="#dom-permissionname-background-fetch">"background-fetch"</a><span>, in §10.6</span>
   <li><a href="#dom-permissionname-background-sync">"background-sync"</a><span>, in §10.7</span>
   <li><a href="#boolean-feature">boolean feature</a><span>, in §10</span>
   <li><a href="#boolean-permission-query-algorithm">boolean permission query algorithm</a><span>, in §9</span>
   <li><a href="#dom-permissionname-camera">"camera"</a><span>, in §10.5</span>
   <li><a href="#dom-permissionname-clipboard">"clipboard"</a><span>, in §10.12</span>
   <li><a href="#create-a-permissionstatus">create a PermissionStatus</a><span>, in §6</span>
   <li><a href="#dom-permissionstate-denied">"denied"</a><span>, in §6</span>
   <li><a href="#dom-permissionsetparameters-descriptor">descriptor</a><span>, in §11</span>
   <li><a href="#dom-devicepermissiondescriptor-deviceid">deviceId</a><span>, in §10.5</span>
   <li><a href="#dom-permissionname-device-info">"device-info"</a><span>, in §10.5</span>
   <li><a href="#dictdef-devicepermissiondescriptor">DevicePermissionDescriptor</a><span>, in §10.5</span>
   <li><a href="#dom-permissionname-display-capture">"display-capture"</a><span>, in §10.13</span>
   <li><a href="#extra-permission-data">extra permission data</a><span>, in §5.1</span>
   <li><a href="#extra-permission-data-constraints">extra permission data constraints</a><span>, in §10</span>
   <li><a href="#extra-permission-data-type">extra permission data type</a><span>, in §10</span>
   <li><a href="#powerful-feature">feature</a><span>, in §3</span>
   <li><a href="#dom-permissionname-geolocation">"geolocation"</a><span>, in §10.1</span>
   <li><a href="#dom-permissionstate-granted">"granted"</a><span>, in §6</span>
   <li><a href="#dom-permissionname-gyroscope">"gyroscope"</a><span>, in §10.10</span>
   <li><a href="#implicit-signals">implicit signals</a><span>, in §3</span>
   <li><a href="#dom-permissionname-magnetometer">"magnetometer"</a><span>, in §10.11</span>
   <li><a href="#dom-permissionname-microphone">"microphone"</a><span>, in §10.5</span>
   <li><a href="#dom-permissionname-midi">"midi"</a><span>, in §10.4</span>
   <li><a href="#dictdef-midipermissiondescriptor">MidiPermissionDescriptor</a><span>, in §10.4</span>
   <li><a href="#dom-permissiondescriptor-name">name</a><span>, in §4</span>
   <li><a href="#new-information-about-the-users-intent">New information about the user’s intent</a><span>, in §3</span>
   <li><a href="#dom-permissionname-nfc">"nfc"</a><span>, in §10.14</span>
   <li><a href="#dom-permissionname-notifications">"notifications"</a><span>, in §10.2</span>
   <li><a href="#dom-permissionstatus-onchange">onchange</a><span>, in §6</span>
   <li><a href="#dom-permissionsetparameters-onerealm">oneRealm</a><span>, in §11</span>
   <li><a href="#dictdef-permissiondescriptor">PermissionDescriptor</a><span>, in §4</span>
   <li><a href="#permission-descriptor-type">permission descriptor type</a><span>, in §10</span>
   <li><a href="#enumdef-permissionname">PermissionName</a><span>, in §10</span>
   <li><a href="#permission-query-algorithm">permission query algorithm</a><span>, in §10</span>
   <li><a href="#permission-result-type">permission result type</a><span>, in §10</span>
   <li><a href="#permission-revocation-algorithm">permission revocation algorithm</a><span>, in §10</span>
   <li><a href="#permissions">Permissions</a><span>, in §8</span>
   <li>
    permissions
    <ul>
     <li><a href="#dom-navigator-permissions">attribute for Navigator</a><span>, in §7</span>
     <li><a href="#dom-workernavigator-permissions">attribute for WorkerNavigator</a><span>, in §7</span>
    </ul>
   <li><a href="#dictdef-permissionsetparameters">PermissionSetParameters</a><span>, in §11</span>
   <li><a href="#permission-state">permission state</a><span>, in §5.1</span>
   <li><a href="#enumdef-permissionstate">PermissionState</a><span>, in §6</span>
   <li><a href="#permission-state-constraints">permission state constraints</a><span>, in §10</span>
   <li><a href="#permissionstatus">PermissionStatus</a><span>, in §6</span>
   <li><a href="#permission-task-source">permission task source</a><span>, in §6</span>
   <li><a href="#powerful-feature">Powerful feature</a><span>, in §3</span>
   <li><a href="#dom-permissionstate-prompt">"prompt"</a><span>, in §6</span>
   <li><a href="#prompt-the-user-to-choose">prompting the user to choose</a><span>, in §5.2</span>
   <li><a href="#prompt-the-user-to-choose">prompt the user to choose</a><span>, in §5.2</span>
   <li><a href="#dom-permissionname-push">"push"</a><span>, in §10.3</span>
   <li><a href="#dictdef-pushpermissiondescriptor">PushPermissionDescriptor</a><span>, in §10.3</span>
   <li><a href="#dom-permissionstatus-query-slot">[[query]]</a><span>, in §6</span>
   <li><a href="#query-a-permission">query a permission</a><span>, in §8</span>
   <li><a href="#dom-permissions-query">query(permissionDesc)</a><span>, in §8</span>
   <li><a href="#request-permission-to-use">requesting permission to use</a><span>, in §5.2</span>
   <li><a href="#request-permission-to-use">request permission to use</a><span>, in §5.2</span>
   <li><a href="#set-permission">Set Permission</a><span>, in §11.1</span>
   <li><a href="#dom-permissionname-speaker">"speaker"</a><span>, in §10.5</span>
   <li>
    state
    <ul>
     <li><a href="#dom-permissionstatus-state">attribute for PermissionStatus</a><span>, in §6</span>
     <li><a href="#permission-state">definition of</a><span>, in §5.1</span>
     <li><a href="#dom-permissionsetparameters-state">dict-member for PermissionSetParameters</a><span>, in §11</span>
    </ul>
   <li><a href="#permissiondescriptor-stronger-than">stronger than</a><span>, in §10</span>
   <li><a href="#dom-midipermissiondescriptor-sysex">sysex</a><span>, in §10.4</span>
   <li><a href="#dom-pushpermissiondescriptor-uservisibleonly">userVisibleOnly</a><span>, in §10.3</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-eventtarget">
   <a href="https://dom.spec.whatwg.org/#eventtarget">https://dom.spec.whatwg.org/#eventtarget</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventtarget">6. 
    Status of a permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event-fire">
   <a href="https://dom.spec.whatwg.org/#concept-event-fire">https://dom.spec.whatwg.org/#concept-event-fire</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event-fire">6. 
    Status of a permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-current-realm">
   <a href="https://tc39.github.io/ecma262/#current-realm">https://tc39.github.io/ecma262/#current-realm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-current-realm">5.1. Reading the current permission state</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-code-realms">
   <a href="https://tc39.github.io/ecma262/#sec-code-realms">https://tc39.github.io/ecma262/#sec-code-realms</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-code-realms">5. Permission states</a>
    <li><a href="#ref-for-sec-code-realms①">5.2. Requesting more permission</a> <a href="#ref-for-sec-code-realms②">(2)</a> <a href="#ref-for-sec-code-realms③">(3)</a>
    <li><a href="#ref-for-sec-code-realms④">5.3. Reacting to users revoking permission</a>
    <li><a href="#ref-for-sec-code-realms⑤">10.5. 
      Media Devices </a> <a href="#ref-for-sec-code-realms⑥">(2)</a> <a href="#ref-for-sec-code-realms⑦">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-policy-controlled-feature">
   <a href="https://wicg.github.io/feature-policy/#policy-controlled-feature">https://wicg.github.io/feature-policy/#policy-controlled-feature</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-policy-controlled-feature">5.1. Reading the current permission state</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventhandler">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler">https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventhandler">6. 
    Status of a permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-navigator">
   <a href="https://html.spec.whatwg.org/multipage/system-state.html#navigator">https://html.spec.whatwg.org/multipage/system-state.html#navigator</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-navigator">7. 
    Navigator and WorkerNavigator extension </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-workernavigator">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#workernavigator">https://html.spec.whatwg.org/multipage/workers.html#workernavigator</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-workernavigator">7. 
    Navigator and WorkerNavigator extension </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-active-document">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">https://html.spec.whatwg.org/multipage/browsers.html#active-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-active-document">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-allowed-to-use">
   <a href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#allowed-to-use">https://html.spec.whatwg.org/multipage/iframe-embed-object.html#allowed-to-use</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-allowed-to-use">5.1. Reading the current permission state</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-document-window">
   <a href="https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window">https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-document-window">5.1. Reading the current permission state</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-current-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-current-settings-object">5.1. Reading the current permission state</a> <a href="#ref-for-current-settings-object①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-environment-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-environment-settings-object">3. Definitions</a>
    <li><a href="#ref-for-environment-settings-object①">5.1. Reading the current permission state</a> <a href="#ref-for-environment-settings-object②">(2)</a>
    <li><a href="#ref-for-environment-settings-object③">11.1. 
      Set Permission </a> <a href="#ref-for-environment-settings-object④">(2)</a> <a href="#ref-for-environment-settings-object⑤">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handlers">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers">https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handlers">6. 
    Status of a permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handler-event-type">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type">https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handler-event-type">6. 
    Status of a permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-settings-object-origin">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin">https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-settings-object-origin">11.1. 
      Set Permission </a> <a href="#ref-for-concept-settings-object-origin①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-queue-a-task">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-queue-a-task">5.3. Reacting to users revoking permission</a>
    <li><a href="#ref-for-queue-a-task①">6. 
    Status of a permission </a>
    <li><a href="#ref-for-queue-a-task②">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-responsible-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context">https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-responsible-browsing-context">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-responsible-event-loop">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop">https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-responsible-event-loop">5.3. Reacting to users revoking permission</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-same-origin">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#same-origin">https://html.spec.whatwg.org/multipage/origin.html#same-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-same-origin">5.2. Requesting more permission</a> <a href="#ref-for-same-origin①">(2)</a>
    <li><a href="#ref-for-same-origin②">10.5. 
      Media Devices </a>
    <li><a href="#ref-for-same-origin③">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-realm-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-realm-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#concept-realm-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-realm-settings-object">5.3. Reacting to users revoking permission</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-task">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task">https://html.spec.whatwg.org/multipage/webappapis.html#concept-task</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-task">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-append">
   <a href="https://infra.spec.whatwg.org/#list-append">https://infra.spec.whatwg.org/#list-append</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-append">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list">
   <a href="https://infra.spec.whatwg.org/#list">https://infra.spec.whatwg.org/#list</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list">11.1. 
      Set Permission </a> <a href="#ref-for-list①">(2)</a> <a href="#ref-for-list②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-install">
   <a href="https://w3c.github.io/manifest/#dfn-install">https://w3c.github.io/manifest/#dfn-install</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-install">3. Definitions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-deviceid">
   <a href="https://w3c.github.io/mediacapture-main/#deviceid">https://w3c.github.io/mediacapture-main/#deviceid</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-deviceid">10.5. 
      Media Devices </a> <a href="#ref-for-deviceid①">(2)</a> <a href="#ref-for-deviceid②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-devicechange">
   <a href="https://w3c.github.io/mediacapture-main/#devicechange">https://w3c.github.io/mediacapture-main/#devicechange</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-devicechange">10.5. 
      Media Devices </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-mediadevices-getusermedia">
   <a href="https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia">https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-mediadevices-getusermedia">5.1. Reading the current permission state</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-boolean-permission-request-algorithm">
   <a href="https://wicg.github.io/permissions-request/#boolean-permission-request-algorithm">https://wicg.github.io/permissions-request/#boolean-permission-request-algorithm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-boolean-permission-request-algorithm">10.5. 
      Media Devices </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-permission-request-algorithm">
   <a href="https://wicg.github.io/permissions-request/#permission-request-algorithm">https://wicg.github.io/permissions-request/#permission-request-algorithm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-request-algorithm">10.5. 
      Media Devices </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-a-promise-rejected-with">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with">https://www.w3.org/2001/tag/doc/promises-guide/#a-promise-rejected-with</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-a-promise-rejected-with">8. 
    Permissions interface </a> <a href="#ref-for-a-promise-rejected-with①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-non-secure-contexts">
   <a href="https://w3c.github.io/webappsec-secure-contexts/#non-secure-contexts">https://w3c.github.io/webappsec-secure-contexts/#non-secure-contexts</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-non-secure-contexts">5.1. Reading the current permission state</a>
    <li><a href="#ref-for-non-secure-contexts①">10. 
    Permission Registry </a>
    <li><a href="#ref-for-non-secure-contexts②">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-secure-contexts">
   <a href="https://w3c.github.io/webappsec-secure-contexts/#secure-contexts">https://w3c.github.io/webappsec-secure-contexts/#secure-contexts</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-secure-contexts">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-generic-sensor-permission-revocation-algorithm">
   <a href="https://w3c.github.io/sensors/#generic-sensor-permission-revocation-algorithm">https://w3c.github.io/sensors/#generic-sensor-permission-revocation-algorithm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-generic-sensor-permission-revocation-algorithm">10.8. 
      Ambient Light Sensor </a>
    <li><a href="#ref-for-generic-sensor-permission-revocation-algorithm①">10.9. 
      Accelerometer </a>
    <li><a href="#ref-for-generic-sensor-permission-revocation-algorithm②">10.10. 
      Gyroscope </a>
    <li><a href="#ref-for-generic-sensor-permission-revocation-algorithm③">10.11. 
      Magnetometer </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-permissionname-persistent-storage">
   <a href="https://storage.spec.whatwg.org/#dom-permissionname-persistent-storage">https://storage.spec.whatwg.org/#dom-permissionname-persistent-storage</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-persistent-storage">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-user-agent">
   <a href="https://www.w3.org/TR/uievents/#user-agent">https://www.w3.org/TR/uievents/#user-agent</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-user-agent">6. 
    Status of a permission </a> <a href="#ref-for-user-agent①">(2)</a> <a href="#ref-for-user-agent②">(3)</a>
    <li><a href="#ref-for-user-agent③">8. 
    Permissions interface </a>
    <li><a href="#ref-for-user-agent④">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-permissionname-bluetooth">
   <a href="https://webbluetoothcg.github.io/web-bluetooth/#dom-permissionname-bluetooth">https://webbluetoothcg.github.io/web-bluetooth/#dom-permissionname-bluetooth</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-bluetooth">4. 
    Descriptions of permission requests </a>
    <li><a href="#ref-for-dom-permissionname-bluetooth①">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-bluetoothlescanfilterinit">
   <a href="https://webbluetoothcg.github.io/web-bluetooth/#dictdef-bluetoothlescanfilterinit">https://webbluetoothcg.github.io/web-bluetooth/#dictdef-bluetoothlescanfilterinit</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-bluetoothlescanfilterinit">4. 
    Descriptions of permission requests </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-typedefdef-bluetoothserviceuuid">
   <a href="https://webbluetoothcg.github.io/web-bluetooth/#typedefdef-bluetoothserviceuuid">https://webbluetoothcg.github.io/web-bluetooth/#typedefdef-bluetoothserviceuuid</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-typedefdef-bluetoothserviceuuid">4. 
    Descriptions of permission requests </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-current-browsing-context">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-current-browsing-context">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-current-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-current-browsing-context">11.1. 
      Set Permission </a> <a href="#ref-for-dfn-current-browsing-context①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-extension-commands">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-commands">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-commands</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-extension-commands">11. 
    Automation </a>
    <li><a href="#ref-for-dfn-extension-commands①">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-extension-command-uri-template">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-command-uri-template">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-extension-command-uri-template</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-extension-command-uri-template">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-invalid-argument">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-invalid-argument">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-invalid-argument</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-invalid-argument">11.1. 
      Set Permission </a> <a href="#ref-for-dfn-invalid-argument①">(2)</a> <a href="#ref-for-dfn-invalid-argument②">(3)</a> <a href="#ref-for-dfn-invalid-argument③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-local-end">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-local-end">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-local-end</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-local-end">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-remote-end-steps">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-remote-end-steps">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-remote-end-steps</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-remote-end-steps">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-session">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-session">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-session</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-session">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-success">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-success">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-success</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-success">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-error">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-error">11.1. 
      Set Permission </a> <a href="#ref-for-dfn-error①">(2)</a> <a href="#ref-for-dfn-error②">(3)</a> <a href="#ref-for-dfn-error③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-error-code">
   <a href="https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code">https://w3c.github.io/webdriver/webdriver-spec.html#dfn-error-code</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-error-code">11.1. 
      Set Permission </a> <a href="#ref-for-dfn-error-code①">(2)</a> <a href="#ref-for-dfn-error-code②">(3)</a> <a href="#ref-for-dfn-error-code③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMString">
   <a href="https://heycam.github.io/webidl/#idl-DOMString">https://heycam.github.io/webidl/#idl-DOMString</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMString">10.5. 
      Media Devices </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Exposed">
   <a href="https://heycam.github.io/webidl/#Exposed">https://heycam.github.io/webidl/#Exposed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Exposed">6. 
    Status of a permission </a>
    <li><a href="#ref-for-Exposed①">7. 
    Navigator and WorkerNavigator extension </a> <a href="#ref-for-Exposed②">(2)</a>
    <li><a href="#ref-for-Exposed③">8. 
    Permissions interface </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-promise">
   <a href="https://heycam.github.io/webidl/#idl-promise">https://heycam.github.io/webidl/#idl-promise</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-promise">8. 
    Permissions interface </a> <a href="#ref-for-idl-promise①">(2)</a>
    <li><a href="#ref-for-idl-promise②">12. 
    Examples </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SameObject">
   <a href="https://heycam.github.io/webidl/#SameObject">https://heycam.github.io/webidl/#SameObject</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SameObject">7. 
    Navigator and WorkerNavigator extension </a> <a href="#ref-for-SameObject①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-boolean">
   <a href="https://heycam.github.io/webidl/#idl-boolean">https://heycam.github.io/webidl/#idl-boolean</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-boolean">10.3. 
      Push </a>
    <li><a href="#ref-for-idl-boolean①">10.4. 
      Midi </a>
    <li><a href="#ref-for-idl-boolean②">11. 
    Automation </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-convert-ecmascript-to-idl-value">
   <a href="https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value">https://heycam.github.io/webidl/#dfn-convert-ecmascript-to-idl-value</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-convert-ecmascript-to-idl-value">8. 
    Permissions interface </a> <a href="#ref-for-dfn-convert-ecmascript-to-idl-value①">(2)</a>
    <li><a href="#ref-for-dfn-convert-ecmascript-to-idl-value②">11.1. 
      Set Permission </a> <a href="#ref-for-dfn-convert-ecmascript-to-idl-value③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-object">
   <a href="https://heycam.github.io/webidl/#idl-object">https://heycam.github.io/webidl/#idl-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-object">8. 
    Permissions interface </a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[DOM]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-eventtarget" style="color:initial">EventTarget</span>
     <li><span class="dfn-paneled" id="term-for-concept-event-fire" style="color:initial">fire an event</span>
    </ul>
   <li>
    <a data-link-type="biblio">[ECMASCRIPT]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-current-realm" style="color:initial">current realm</span>
     <li><span class="dfn-paneled" id="term-for-sec-code-realms" style="color:initial">realm</span>
    </ul>
   <li>
    <a data-link-type="biblio">[feature-policy-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-policy-controlled-feature" style="color:initial">policy-controlled feature</span>
    </ul>
   <li>
    <a data-link-type="biblio">[HTML]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-eventhandler" style="color:initial">EventHandler</span>
     <li><span class="dfn-paneled" id="term-for-navigator" style="color:initial">Navigator</span>
     <li><span class="dfn-paneled" id="term-for-workernavigator" style="color:initial">WorkerNavigator</span>
     <li><span class="dfn-paneled" id="term-for-active-document" style="color:initial">active document</span>
     <li><span class="dfn-paneled" id="term-for-allowed-to-use" style="color:initial">allowed to use</span>
     <li><span class="dfn-paneled" id="term-for-concept-document-window" style="color:initial">associated document</span>
     <li><span class="dfn-paneled" id="term-for-current-settings-object" style="color:initial">current settings object</span>
     <li><span class="dfn-paneled" id="term-for-environment-settings-object" style="color:initial">environment settings object</span>
     <li><span class="dfn-paneled" id="term-for-event-handlers" style="color:initial">event handler</span>
     <li><span class="dfn-paneled" id="term-for-event-handler-event-type" style="color:initial">event handler event type</span>
     <li><span class="dfn-paneled" id="term-for-concept-settings-object-origin" style="color:initial">origin</span>
     <li><span class="dfn-paneled" id="term-for-queue-a-task" style="color:initial">queue a task</span>
     <li><span class="dfn-paneled" id="term-for-responsible-browsing-context" style="color:initial">responsible browsing context</span>
     <li><span class="dfn-paneled" id="term-for-responsible-event-loop" style="color:initial">responsible event loop</span>
     <li><span class="dfn-paneled" id="term-for-same-origin" style="color:initial">same origin</span>
     <li><span class="dfn-paneled" id="term-for-concept-realm-settings-object" style="color:initial">settings object</span>
     <li><span class="dfn-paneled" id="term-for-concept-task" style="color:initial">task</span>
    </ul>
   <li>
    <a data-link-type="biblio">[INFRA]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-list-append" style="color:initial">append</span>
     <li><span class="dfn-paneled" id="term-for-list" style="color:initial">list</span>
    </ul>
   <li>
    <a data-link-type="biblio">[manifest]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dfn-install" style="color:initial">install</span>
    </ul>
   <li>
    <a data-link-type="biblio">[mediacapture-main]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-deviceid" style="color:initial">deviceId</span>
     <li><span class="dfn-paneled" id="term-for-devicechange" style="color:initial">devicechange</span>
     <li><span class="dfn-paneled" id="term-for-dom-mediadevices-getusermedia" style="color:initial">getUserMedia()</span>
    </ul>
   <li>
    <a data-link-type="biblio">[PERMISSIONS-REQUEST]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-boolean-permission-request-algorithm" style="color:initial">boolean permission request algorithm</span>
     <li><span class="dfn-paneled" id="term-for-permission-request-algorithm" style="color:initial">permission request algorithm</span>
    </ul>
   <li>
    <a data-link-type="biblio">[promises-guide]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-a-promise-rejected-with" style="color:initial">a promise rejected with</span>
    </ul>
   <li>
    <a data-link-type="biblio">[secure-contexts]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-non-secure-contexts" style="color:initial">non-secure contexts</span>
     <li><span class="dfn-paneled" id="term-for-secure-contexts" style="color:initial">secure contexts</span>
    </ul>
   <li>
    <a data-link-type="biblio">[sensors]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-generic-sensor-permission-revocation-algorithm" style="color:initial">generic sensor permission revocation algorithm</span>
    </ul>
   <li>
    <a data-link-type="biblio">[STORAGE]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dom-permissionname-persistent-storage" style="color:initial">"persistent-storage"</span>
    </ul>
   <li>
    <a data-link-type="biblio">[uievents]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-user-agent" style="color:initial">user agent</span>
    </ul>
   <li>
    <a data-link-type="biblio">[web-bluetooth]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dom-permissionname-bluetooth" style="color:initial">"bluetooth"</span>
     <li><span class="dfn-paneled" id="term-for-dictdef-bluetoothlescanfilterinit" style="color:initial">BluetoothLEScanFilterInit</span>
     <li><span class="dfn-paneled" id="term-for-typedefdef-bluetoothserviceuuid" style="color:initial">BluetoothServiceUUID</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebDriver]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dfn-current-browsing-context" style="color:initial">current browsing context</span>
     <li><span class="dfn-paneled" id="term-for-dfn-extension-commands" style="color:initial">extension command</span>
     <li><span class="dfn-paneled" id="term-for-dfn-extension-command-uri-template" style="color:initial">extension command uri template</span>
     <li><span class="dfn-paneled" id="term-for-dfn-invalid-argument" style="color:initial">invalid argument</span>
     <li><span class="dfn-paneled" id="term-for-dfn-local-end" style="color:initial">local end</span>
     <li><span class="dfn-paneled" id="term-for-dfn-remote-end-steps" style="color:initial">remote end steps</span>
     <li><span class="dfn-paneled" id="term-for-dfn-session" style="color:initial">session</span>
     <li><span class="dfn-paneled" id="term-for-dfn-success" style="color:initial">success</span>
     <li><span class="dfn-paneled" id="term-for-dfn-error" style="color:initial">webdriver error</span>
     <li><span class="dfn-paneled" id="term-for-dfn-error-code" style="color:initial">webdriver error code</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebIDL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-idl-DOMString" style="color:initial">DOMString</span>
     <li><span class="dfn-paneled" id="term-for-Exposed" style="color:initial">Exposed</span>
     <li><span class="dfn-paneled" id="term-for-idl-promise" style="color:initial">Promise</span>
     <li><span class="dfn-paneled" id="term-for-SameObject" style="color:initial">SameObject</span>
     <li><span class="dfn-paneled" id="term-for-idl-boolean" style="color:initial">boolean</span>
     <li><span class="dfn-paneled" id="term-for-dfn-convert-ecmascript-to-idl-value" style="color:initial">converted to an idl value</span>
     <li><span class="dfn-paneled" id="term-for-idl-object" style="color:initial">object</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-dom">[DOM]
   <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
   <dt id="biblio-ecmascript">[ECMASCRIPT]
   <dd><a href="https://tc39.github.io/ecma262/">ECMAScript Language Specification</a>. URL: <a href="https://tc39.github.io/ecma262/">https://tc39.github.io/ecma262/</a>
   <dt id="biblio-feature-policy-1">[FEATURE-POLICY-1]
   <dd>Ian Clelland. <a href="https://www.w3.org/TR/feature-policy-1/">Feature Policy</a>. 16 April 2019. WD. URL: <a href="https://www.w3.org/TR/feature-policy-1/">https://www.w3.org/TR/feature-policy-1/</a>
   <dt id="biblio-html">[HTML]
   <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
   <dt id="biblio-infra">[INFRA]
   <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/">Infra Standard</a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a>
   <dt id="biblio-permissions-request">[PERMISSIONS-REQUEST]
   <dd><a href="https://wicg.github.io/permissions-request/">Requesting Permissions</a>. Living Standard. URL: <a href="https://wicg.github.io/permissions-request/">https://wicg.github.io/permissions-request/</a>
   <dt id="biblio-promises-guide">[PROMISES-GUIDE]
   <dd>Domenic Denicola. <a href="https://www.w3.org/2001/tag/doc/promises-guide">Writing Promise-Using Specifications</a>. 9 November 2018. TAG Finding. URL: <a href="https://www.w3.org/2001/tag/doc/promises-guide">https://www.w3.org/2001/tag/doc/promises-guide</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-secure-contexts">[SECURE-CONTEXTS]
   <dd>Mike West. <a href="https://www.w3.org/TR/secure-contexts/">Secure Contexts</a>. 15 September 2016. CR. URL: <a href="https://www.w3.org/TR/secure-contexts/">https://www.w3.org/TR/secure-contexts/</a>
   <dt id="biblio-storage">[STORAGE]
   <dd>Anne van Kesteren. <a href="https://storage.spec.whatwg.org/">Storage Standard</a>. Living Standard. URL: <a href="https://storage.spec.whatwg.org/">https://storage.spec.whatwg.org/</a>
   <dt id="biblio-uievents">[UIEVENTS]
   <dd>Gary Kacmarcik; Travis Leithead; Doug Schepers. <a href="https://www.w3.org/TR/uievents/">UI Events</a>. 30 May 2019. WD. URL: <a href="https://www.w3.org/TR/uievents/">https://www.w3.org/TR/uievents/</a>
   <dt id="biblio-web-bluetooth">[WEB-BLUETOOTH]
   <dd>Jeffrey Yasskin. <a href="https://webbluetoothcg.github.io/web-bluetooth/">Web Bluetooth</a>. Draft Community Group Report. URL: <a href="https://webbluetoothcg.github.io/web-bluetooth/">https://webbluetoothcg.github.io/web-bluetooth/</a>
   <dt id="biblio-webdriver">[WebDriver]
   <dd>Simon Stewart; David Burns. <a href="https://www.w3.org/TR/webdriver1/">WebDriver</a>. 5 June 2018. REC. URL: <a href="https://www.w3.org/TR/webdriver1/">https://www.w3.org/TR/webdriver1/</a>
   <dt id="biblio-webidl">[WebIDL]
   <dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/">Web IDL</a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-accelerometer">[ACCELEROMETER]
   <dd>Anssi Kostiainen. <a href="https://www.w3.org/TR/accelerometer/">Accelerometer</a>. 7 March 2019. WD. URL: <a href="https://www.w3.org/TR/accelerometer/">https://www.w3.org/TR/accelerometer/</a>
   <dt id="biblio-ambient-light">[AMBIENT-LIGHT]
   <dd>Anssi Kostiainen. <a href="https://www.w3.org/TR/ambient-light/">Ambient Light Sensor</a>. 7 March 2019. WD. URL: <a href="https://www.w3.org/TR/ambient-light/">https://www.w3.org/TR/ambient-light/</a>
   <dt id="biblio-audio-output">[AUDIO-OUTPUT]
   <dd>Justin Uberti; Guido Urdaneta. <a href="https://www.w3.org/TR/audio-output/">Audio Output Devices API</a>. 3 October 2017. CR. URL: <a href="https://www.w3.org/TR/audio-output/">https://www.w3.org/TR/audio-output/</a>
   <dt id="biblio-background-fetch">[BACKGROUND-FETCH]
   <dd><a href="https://wicg.github.io/background-fetch/">Background Fetch</a>. Living Standard. URL: <a href="https://wicg.github.io/background-fetch/">https://wicg.github.io/background-fetch/</a>
   <dt id="biblio-clipboard-apis">[CLIPBOARD-APIS]
   <dd>Gary Kacmarcik; Grisha Lyukshin; Hallvord Steen. <a href="https://www.w3.org/TR/clipboard-apis/">Clipboard API and events</a>. 30 May 2019. WD. URL: <a href="https://www.w3.org/TR/clipboard-apis/">https://www.w3.org/TR/clipboard-apis/</a>
   <dt id="biblio-geolocation-api">[geolocation-API]
   <dd>Andrei Popescu. <a href="https://www.w3.org/TR/geolocation-API/">Geolocation API Specification 2nd Edition</a>. 8 November 2016. REC. URL: <a href="https://www.w3.org/TR/geolocation-API/">https://www.w3.org/TR/geolocation-API/</a>
   <dt id="biblio-getusermedia">[GETUSERMEDIA]
   <dd>Daniel Burnett; et al. <a href="https://www.w3.org/TR/mediacapture-streams/">Media Capture and Streams</a>. 3 October 2017. CR. URL: <a href="https://www.w3.org/TR/mediacapture-streams/">https://www.w3.org/TR/mediacapture-streams/</a>
   <dt id="biblio-gyroscope">[GYROSCOPE]
   <dd>Anssi Kostiainen. <a href="https://www.w3.org/TR/gyroscope/">Gyroscope</a>. 7 March 2019. WD. URL: <a href="https://www.w3.org/TR/gyroscope/">https://www.w3.org/TR/gyroscope/</a>
   <dt id="biblio-magnetometer">[MAGNETOMETER]
   <dd>Anssi Kostiainen; Rijubrata Bhaumik. <a href="https://www.w3.org/TR/magnetometer/">Magnetometer</a>. 7 March 2019. WD. URL: <a href="https://www.w3.org/TR/magnetometer/">https://www.w3.org/TR/magnetometer/</a>
   <dt id="biblio-notifications">[NOTIFICATIONS]
   <dd>Anne van Kesteren. <a href="https://notifications.spec.whatwg.org/">Notifications API Standard</a>. Living Standard. URL: <a href="https://notifications.spec.whatwg.org/">https://notifications.spec.whatwg.org/</a>
   <dt id="biblio-push-api">[PUSH-API]
   <dd>Peter Beverloo; Martin Thomson. <a href="https://www.w3.org/TR/push-api/">Push API</a>. 3 June 2019. WD. URL: <a href="https://www.w3.org/TR/push-api/">https://www.w3.org/TR/push-api/</a>
   <dt id="biblio-screen-capture">[SCREEN-CAPTURE]
   <dd>Martin Thomson; Keith Griffin. <a href="https://www.w3.org/TR/screen-capture/">Screen Capture</a>. 14 July 2016. WD. URL: <a href="https://www.w3.org/TR/screen-capture/">https://www.w3.org/TR/screen-capture/</a>
   <dt id="biblio-web-background-sync">[WEB-BACKGROUND-SYNC]
   <dd><a href="https://wicg.github.io/BackgroundSync/spec/">Web Background Synchronization</a>. Living Standard. URL: <a href="https://wicg.github.io/BackgroundSync/spec/">https://wicg.github.io/BackgroundSync/spec/</a>
   <dt id="biblio-web-nfc">[WEB-NFC]
   <dd><a href="https://w3c.github.io/web-nfc/">Web NFC API</a>. ED. URL: <a href="https://w3c.github.io/web-nfc/">https://w3c.github.io/web-nfc/</a>
   <dt id="biblio-webmidi">[WEBMIDI]
   <dd>Chris Wilson; Jussi Kalliokoski. <a href="https://www.w3.org/TR/webmidi/">Web MIDI API</a>. 17 March 2015. WD. URL: <a href="https://www.w3.org/TR/webmidi/">https://www.w3.org/TR/webmidi/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
<pre class="idl highlight def"><c- b>dictionary</c-> <a href="#dictdef-permissiondescriptor"><code><c- g>PermissionDescriptor</c-></code></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#enumdef-permissionname" id="ref-for-enumdef-permissionname⑦"><c- n>PermissionName</c-></a> <a data-type="PermissionName " href="#dom-permissiondescriptor-name"><code><c- g>name</c-></code></a>;
};

<c- b>enum</c-> <a href="#enumdef-permissionstate"><code><c- g>PermissionState</c-></code></a> {
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionstate-granted" id="ref-for-dom-permissionstate-granted⑥①"><c- s>"granted"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionstate-denied" id="ref-for-dom-permissionstate-denied①⓪①"><c- s>"denied"</c-></a>,
  <a class="idl-code" data-link-type="enum-value" href="#dom-permissionstate-prompt" id="ref-for-dom-permissionstate-prompt③①"><c- s>"prompt"</c-></a>,
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a href="#permissionstatus"><code><c- g>PermissionStatus</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget①"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#enumdef-permissionstate" id="ref-for-enumdef-permissionstate①①"><c- n>PermissionState</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="PermissionState" href="#dom-permissionstatus-state" id="ref-for-dom-permissionstatus-state①"><c- g>state</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#dom-permissionstatus-onchange" id="ref-for-dom-permissionstatus-onchange①"><c- g>onchange</c-></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①"><c- g>Exposed</c-></a>=(<c- n>Window</c->)]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator①"><c- g>Navigator</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject②"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#permissions" id="ref-for-permissions③"><c- n>Permissions</c-></a> <a data-readonly data-type="Permissions" href="#dom-navigator-permissions"><code><c- g>permissions</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②①"><c- g>Exposed</c-></a>=(<c- n>Worker</c->)]
<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/workers.html#workernavigator" id="ref-for-workernavigator①"><c- g>WorkerNavigator</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#permissions" id="ref-for-permissions①①"><c- n>Permissions</c-></a> <a data-readonly data-type="Permissions" href="#dom-workernavigator-permissions"><code><c- g>permissions</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a href="#permissions"><code><c- g>Permissions</c-></code></a> {
  <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#permissionstatus" id="ref-for-permissionstatus②①"><c- n>PermissionStatus</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-permissions-query" id="ref-for-dom-permissions-query①①"><c- g>query</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object①"><c- b>object</c-></a> <a href="#dom-permissions-query-permissiondesc-permissiondesc"><code><c- g>permissionDesc</c-></code></a>);
};

<c- b>dictionary</c-> <a href="#dictdef-pushpermissiondescriptor"><code><c- g>PushPermissionDescriptor</c-></code></a> : <a class="n" data-link-type="idl-name" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor⑨①"><c- n>PermissionDescriptor</c-></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean③"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-pushpermissiondescriptor-uservisibleonly"><code><c- g>userVisibleOnly</c-></code></a> = <c- b>false</c->;
};

<c- b>dictionary</c-> <a href="#dictdef-midipermissiondescriptor"><code><c- g>MidiPermissionDescriptor</c-></code></a> : <a class="n" data-link-type="idl-name" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①⓪①"><c- n>PermissionDescriptor</c-></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-midipermissiondescriptor-sysex"><code><c- g>sysex</c-></code></a> = <c- b>false</c->;
};

<c- b>dictionary</c-> <a href="#dictdef-devicepermissiondescriptor"><code><c- g>DevicePermissionDescriptor</c-></code></a> : <a class="n" data-link-type="idl-name" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①①①"><c- n>PermissionDescriptor</c-></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-devicepermissiondescriptor-deviceid"><code><c- g>deviceId</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-permissionsetparameters"><code><c- g>PermissionSetParameters</c-></code></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#dictdef-permissiondescriptor" id="ref-for-dictdef-permissiondescriptor①②①"><c- n>PermissionDescriptor</c-></a> <a data-type="PermissionDescriptor " href="#dom-permissionsetparameters-descriptor"><code><c- g>descriptor</c-></code></a>;
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="#enumdef-permissionstate" id="ref-for-enumdef-permissionstate②①"><c- n>PermissionState</c-></a> <a data-type="PermissionState " href="#dom-permissionsetparameters-state"><code><c- g>state</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-permissionsetparameters-onerealm"><code><c- g>oneRealm</c-></code></a> = <c- b>false</c->;
};

</pre>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue"> Safari is the only known UA that returns different results from this
        algorithm for different settings objects with the same origin. We should
        test which of the <a href="https://html.spec.whatwg.org/multipage/webappapis.html#realms-settings-objects-global-objects">several
        possible settings objects</a> it uses. <a href="#issue-current-entry-incumbent-or-relevant"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="new-information-about-the-users-intent">
   <b><a href="#new-information-about-the-users-intent">#new-information-about-the-users-intent</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-new-information-about-the-users-intent">5.1. Reading the current permission state</a> <a href="#ref-for-new-information-about-the-users-intent①">(2)</a>
    <li><a href="#ref-for-new-information-about-the-users-intent②">5.2. Requesting more permission</a> <a href="#ref-for-new-information-about-the-users-intent③">(2)</a> <a href="#ref-for-new-information-about-the-users-intent④">(3)</a>
    <li><a href="#ref-for-new-information-about-the-users-intent⑤">10.5. 
      Media Devices </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="implicit-signals">
   <b><a href="#implicit-signals">#implicit-signals</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-implicit-signals">3. Definitions</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="powerful-feature">
   <b><a href="#powerful-feature">#powerful-feature</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-powerful-feature">4. 
    Descriptions of permission requests </a> <a href="#ref-for-powerful-feature①">(2)</a>
    <li><a href="#ref-for-powerful-feature②">5. Permission states</a> <a href="#ref-for-powerful-feature③">(2)</a>
    <li><a href="#ref-for-powerful-feature④">5.1. Reading the current permission state</a>
    <li><a href="#ref-for-powerful-feature⑤">5.2. Requesting more permission</a>
    <li><a href="#ref-for-powerful-feature⑥">5.3. Reacting to users revoking permission</a>
    <li><a href="#ref-for-powerful-feature⑦">10. 
    Permission Registry </a> <a href="#ref-for-powerful-feature⑧">(2)</a> <a href="#ref-for-powerful-feature⑨">(3)</a> <a href="#ref-for-powerful-feature①⓪">(4)</a>
    <li><a href="#ref-for-powerful-feature①①">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-permissiondescriptor">
   <b><a href="#dictdef-permissiondescriptor">#dictdef-permissiondescriptor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-permissiondescriptor">4. 
    Descriptions of permission requests </a>
    <li><a href="#ref-for-dictdef-permissiondescriptor①">5.1. Reading the current permission state</a>
    <li><a href="#ref-for-dictdef-permissiondescriptor②">5.2. Requesting more permission</a> <a href="#ref-for-dictdef-permissiondescriptor③">(2)</a>
    <li><a href="#ref-for-dictdef-permissiondescriptor④">6. 
    Status of a permission </a>
    <li><a href="#ref-for-dictdef-permissiondescriptor⑤">8. 
    Permissions interface </a>
    <li><a href="#ref-for-dictdef-permissiondescriptor⑥">9. 
    Common permission algorithms </a>
    <li><a href="#ref-for-dictdef-permissiondescriptor⑦">10. 
    Permission Registry </a> <a href="#ref-for-dictdef-permissiondescriptor⑧">(2)</a>
    <li><a href="#ref-for-dictdef-permissiondescriptor⑨">10.3. 
      Push </a>
    <li><a href="#ref-for-dictdef-permissiondescriptor①⓪">10.4. 
      Midi </a>
    <li><a href="#ref-for-dictdef-permissiondescriptor①①">10.5. 
      Media Devices </a>
    <li><a href="#ref-for-dictdef-permissiondescriptor①②">11. 
    Automation </a>
    <li><a href="#ref-for-dictdef-permissiondescriptor①③">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissiondescriptor-name">
   <b><a href="#dom-permissiondescriptor-name">#dom-permissiondescriptor-name</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissiondescriptor-name">5. Permission states</a>
    <li><a href="#ref-for-dom-permissiondescriptor-name①">5.1. Reading the current permission state</a> <a href="#ref-for-dom-permissiondescriptor-name②">(2)</a> <a href="#ref-for-dom-permissiondescriptor-name③">(3)</a> <a href="#ref-for-dom-permissiondescriptor-name④">(4)</a> <a href="#ref-for-dom-permissiondescriptor-name⑤">(5)</a>
    <li><a href="#ref-for-dom-permissiondescriptor-name⑥">5.2. Requesting more permission</a> <a href="#ref-for-dom-permissiondescriptor-name⑦">(2)</a>
    <li><a href="#ref-for-dom-permissiondescriptor-name⑧">6. 
    Status of a permission </a> <a href="#ref-for-dom-permissiondescriptor-name⑨">(2)</a>
    <li><a href="#ref-for-dom-permissiondescriptor-name①⓪">8. 
    Permissions interface </a> <a href="#ref-for-dom-permissiondescriptor-name①①">(2)</a>
    <li><a href="#ref-for-dom-permissiondescriptor-name①②">11.1. 
      Set Permission </a> <a href="#ref-for-dom-permissiondescriptor-name①③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="aspects">
   <b><a href="#aspects">#aspects</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-aspects">4. 
    Descriptions of permission requests </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="permission-state">
   <b><a href="#permission-state">#permission-state</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-state">2. 
    Privacy considerations </a> <a href="#ref-for-permission-state①">(2)</a>
    <li><a href="#ref-for-permission-state②">5.1. Reading the current permission state</a> <a href="#ref-for-permission-state③">(2)</a>
    <li><a href="#ref-for-permission-state④">5.2. Requesting more permission</a> <a href="#ref-for-permission-state⑤">(2)</a> <a href="#ref-for-permission-state⑥">(3)</a>
    <li><a href="#ref-for-permission-state⑦">9. 
    Common permission algorithms </a>
    <li><a href="#ref-for-permission-state⑧">10. 
    Permission Registry </a> <a href="#ref-for-permission-state⑨">(2)</a> <a href="#ref-for-permission-state①⓪">(3)</a> <a href="#ref-for-permission-state①①">(4)</a> <a href="#ref-for-permission-state①②">(5)</a> <a href="#ref-for-permission-state①③">(6)</a>
    <li><a href="#ref-for-permission-state①④">10.5. 
      Media Devices </a> <a href="#ref-for-permission-state①⑤">(2)</a>
    <li><a href="#ref-for-permission-state①⑥">10.13. 
      Screen Capture </a> <a href="#ref-for-permission-state①⑦">(2)</a>
    <li><a href="#ref-for-permission-state①⑧">11.1. 
      Set Permission </a> <a href="#ref-for-permission-state①⑨">(2)</a> <a href="#ref-for-permission-state②⓪">(3)</a> <a href="#ref-for-permission-state②①">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extra-permission-data">
   <b><a href="#extra-permission-data">#extra-permission-data</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extra-permission-data">10. 
    Permission Registry </a> <a href="#ref-for-extra-permission-data①">(2)</a> <a href="#ref-for-extra-permission-data②">(3)</a>
    <li><a href="#ref-for-extra-permission-data③">10.5. 
      Media Devices </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="request-permission-to-use">
   <b><a href="#request-permission-to-use">#request-permission-to-use</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request-permission-to-use">5.2. Requesting more permission</a> <a href="#ref-for-request-permission-to-use①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="prompt-the-user-to-choose">
   <b><a href="#prompt-the-user-to-choose">#prompt-the-user-to-choose</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-prompt-the-user-to-choose">5.2. Requesting more permission</a> <a href="#ref-for-prompt-the-user-to-choose①">(2)</a> <a href="#ref-for-prompt-the-user-to-choose②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="enumdef-permissionstate">
   <b><a href="#enumdef-permissionstate">#enumdef-permissionstate</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-permissionstate">5.1. Reading the current permission state</a>
    <li><a href="#ref-for-enumdef-permissionstate①">6. 
    Status of a permission </a>
    <li><a href="#ref-for-enumdef-permissionstate②">11. 
    Automation </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionstate-granted">
   <b><a href="#dom-permissionstate-granted">#dom-permissionstate-granted</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionstate-granted">2. 
    Privacy considerations </a>
    <li><a href="#ref-for-dom-permissionstate-granted①">5.1. Reading the current permission state</a> <a href="#ref-for-dom-permissionstate-granted②">(2)</a>
    <li><a href="#ref-for-dom-permissionstate-granted③">5.2. Requesting more permission</a> <a href="#ref-for-dom-permissionstate-granted④">(2)</a> <a href="#ref-for-dom-permissionstate-granted⑤">(3)</a>
    <li><a href="#ref-for-dom-permissionstate-granted⑥">6. 
    Status of a permission </a>
    <li><a href="#ref-for-dom-permissionstate-granted⑦">10. 
    Permission Registry </a> <a href="#ref-for-dom-permissionstate-granted⑧">(2)</a>
    <li><a href="#ref-for-dom-permissionstate-granted⑨">10.5. 
      Media Devices </a> <a href="#ref-for-dom-permissionstate-granted①⓪">(2)</a> <a href="#ref-for-dom-permissionstate-granted①①">(3)</a>
    <li><a href="#ref-for-dom-permissionstate-granted①②">10.13. 
      Screen Capture </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionstate-denied">
   <b><a href="#dom-permissionstate-denied">#dom-permissionstate-denied</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionstate-denied">5.1. Reading the current permission state</a> <a href="#ref-for-dom-permissionstate-denied①">(2)</a> <a href="#ref-for-dom-permissionstate-denied②">(3)</a> <a href="#ref-for-dom-permissionstate-denied③">(4)</a>
    <li><a href="#ref-for-dom-permissionstate-denied④">5.2. Requesting more permission</a> <a href="#ref-for-dom-permissionstate-denied⑤">(2)</a> <a href="#ref-for-dom-permissionstate-denied⑥">(3)</a> <a href="#ref-for-dom-permissionstate-denied⑦">(4)</a> <a href="#ref-for-dom-permissionstate-denied⑧">(5)</a> <a href="#ref-for-dom-permissionstate-denied⑨">(6)</a>
    <li><a href="#ref-for-dom-permissionstate-denied①⓪">6. 
    Status of a permission </a>
    <li><a href="#ref-for-dom-permissionstate-denied①①">10. 
    Permission Registry </a> <a href="#ref-for-dom-permissionstate-denied①②">(2)</a>
    <li><a href="#ref-for-dom-permissionstate-denied①③">10.5. 
      Media Devices </a>
    <li><a href="#ref-for-dom-permissionstate-denied①④">10.13. 
      Screen Capture </a>
    <li><a href="#ref-for-dom-permissionstate-denied①⑤">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionstate-prompt">
   <b><a href="#dom-permissionstate-prompt">#dom-permissionstate-prompt</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionstate-prompt">5.1. Reading the current permission state</a> <a href="#ref-for-dom-permissionstate-prompt①">(2)</a>
    <li><a href="#ref-for-dom-permissionstate-prompt②">5.2. Requesting more permission</a>
    <li><a href="#ref-for-dom-permissionstate-prompt③">6. 
    Status of a permission </a>
    <li><a href="#ref-for-dom-permissionstate-prompt④">10.5. 
      Media Devices </a>
    <li><a href="#ref-for-dom-permissionstate-prompt⑤">10.13. 
      Screen Capture </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="permissionstatus">
   <b><a href="#permissionstatus">#permissionstatus</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permissionstatus">6. 
    Status of a permission </a> <a href="#ref-for-permissionstatus①">(2)</a>
    <li><a href="#ref-for-permissionstatus②">8. 
    Permissions interface </a>
    <li><a href="#ref-for-permissionstatus③">9. 
    Common permission algorithms </a>
    <li><a href="#ref-for-permissionstatus④">10. 
    Permission Registry </a> <a href="#ref-for-permissionstatus⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionstatus-query-slot">
   <b><a href="#dom-permissionstatus-query-slot">#dom-permissionstatus-query-slot</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionstatus-query-slot">6. 
    Status of a permission </a> <a href="#ref-for-dom-permissionstatus-query-slot①">(2)</a> <a href="#ref-for-dom-permissionstatus-query-slot②">(3)</a>
    <li><a href="#ref-for-dom-permissionstatus-query-slot③">8. 
    Permissions interface </a> <a href="#ref-for-dom-permissionstatus-query-slot④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="create-a-permissionstatus">
   <b><a href="#create-a-permissionstatus">#create-a-permissionstatus</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-create-a-permissionstatus">8. 
    Permissions interface </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionstatus-state">
   <b><a href="#dom-permissionstatus-state">#dom-permissionstatus-state</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionstatus-state">6. 
    Status of a permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionstatus-onchange">
   <b><a href="#dom-permissionstatus-onchange">#dom-permissionstatus-onchange</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionstatus-onchange">6. 
    Status of a permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="permission-task-source">
   <b><a href="#permission-task-source">#permission-task-source</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-task-source">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="permissions">
   <b><a href="#permissions">#permissions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permissions">7. 
    Navigator and WorkerNavigator extension </a> <a href="#ref-for-permissions①">(2)</a>
    <li><a href="#ref-for-permissions②">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissions-query">
   <b><a href="#dom-permissions-query">#dom-permissions-query</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissions-query">1. 
    Scope of this document </a>
    <li><a href="#ref-for-dom-permissions-query①">8. 
    Permissions interface </a>
    <li><a href="#ref-for-dom-permissions-query②">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="boolean-permission-query-algorithm">
   <b><a href="#boolean-permission-query-algorithm">#boolean-permission-query-algorithm</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-boolean-permission-query-algorithm">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="enumdef-permissionname">
   <b><a href="#enumdef-permissionname">#enumdef-permissionname</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-permissionname">4. 
    Descriptions of permission requests </a>
    <li><a href="#ref-for-enumdef-permissionname①">5.1. Reading the current permission state</a> <a href="#ref-for-enumdef-permissionname②">(2)</a>
    <li><a href="#ref-for-enumdef-permissionname③">5.2. Requesting more permission</a> <a href="#ref-for-enumdef-permissionname④">(2)</a>
    <li><a href="#ref-for-enumdef-permissionname⑤">10. 
    Permission Registry </a> <a href="#ref-for-enumdef-permissionname⑥">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="allowed-in-non-secure-contexts">
   <b><a href="#allowed-in-non-secure-contexts">#allowed-in-non-secure-contexts</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-allowed-in-non-secure-contexts">5.1. Reading the current permission state</a>
    <li><a href="#ref-for-allowed-in-non-secure-contexts①">10.1. 
      Geolocation </a>
    <li><a href="#ref-for-allowed-in-non-secure-contexts②">10.2. 
      Notifications </a>
    <li><a href="#ref-for-allowed-in-non-secure-contexts③">10.4. 
      Midi </a>
    <li><a href="#ref-for-allowed-in-non-secure-contexts④">10.5. 
      Media Devices </a> <a href="#ref-for-allowed-in-non-secure-contexts⑤">(2)</a>
    <li><a href="#ref-for-allowed-in-non-secure-contexts⑥">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="permission-descriptor-type">
   <b><a href="#permission-descriptor-type">#permission-descriptor-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-descriptor-type">4. 
    Descriptions of permission requests </a> <a href="#ref-for-permission-descriptor-type①">(2)</a> <a href="#ref-for-permission-descriptor-type②">(3)</a>
    <li><a href="#ref-for-permission-descriptor-type③">5. Permission states</a>
    <li><a href="#ref-for-permission-descriptor-type④">6. 
    Status of a permission </a>
    <li><a href="#ref-for-permission-descriptor-type⑤">8. 
    Permissions interface </a>
    <li><a href="#ref-for-permission-descriptor-type⑥">10. 
    Permission Registry </a>
    <li><a href="#ref-for-permission-descriptor-type⑦">10.3. 
      Push </a>
    <li><a href="#ref-for-permission-descriptor-type⑧">10.4. 
      Midi </a>
    <li><a href="#ref-for-permission-descriptor-type⑨">10.5. 
      Media Devices </a>
    <li><a href="#ref-for-permission-descriptor-type①⓪">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="permissiondescriptor-stronger-than">
   <b><a href="#permissiondescriptor-stronger-than">#permissiondescriptor-stronger-than</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permissiondescriptor-stronger-than">10. 
    Permission Registry </a>
    <li><a href="#ref-for-permissiondescriptor-stronger-than①">10.3. 
      Push </a>
    <li><a href="#ref-for-permissiondescriptor-stronger-than②">10.4. 
      Midi </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="permission-state-constraints">
   <b><a href="#permission-state-constraints">#permission-state-constraints</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-state-constraints">5.1. Reading the current permission state</a>
    <li><a href="#ref-for-permission-state-constraints①">10.13. 
      Screen Capture </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extra-permission-data-type">
   <b><a href="#extra-permission-data-type">#extra-permission-data-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extra-permission-data-type">5.1. Reading the current permission state</a> <a href="#ref-for-extra-permission-data-type①">(2)</a>
    <li><a href="#ref-for-extra-permission-data-type②">10.5. 
      Media Devices </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extra-permission-data-constraints">
   <b><a href="#extra-permission-data-constraints">#extra-permission-data-constraints</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extra-permission-data-constraints">5.1. Reading the current permission state</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="permission-result-type">
   <b><a href="#permission-result-type">#permission-result-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-result-type">6. 
    Status of a permission </a>
    <li><a href="#ref-for-permission-result-type①">10. 
    Permission Registry </a> <a href="#ref-for-permission-result-type②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="permission-query-algorithm">
   <b><a href="#permission-query-algorithm">#permission-query-algorithm</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-query-algorithm">6. 
    Status of a permission </a>
    <li><a href="#ref-for-permission-query-algorithm①">8. 
    Permissions interface </a>
    <li><a href="#ref-for-permission-query-algorithm②">10.5. 
      Media Devices </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="permission-revocation-algorithm">
   <b><a href="#permission-revocation-algorithm">#permission-revocation-algorithm</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-permission-revocation-algorithm">5.3. Reacting to users revoking permission</a>
    <li><a href="#ref-for-permission-revocation-algorithm①">10.5. 
      Media Devices </a>
    <li><a href="#ref-for-permission-revocation-algorithm②">10.8. 
      Ambient Light Sensor </a>
    <li><a href="#ref-for-permission-revocation-algorithm③">10.9. 
      Accelerometer </a>
    <li><a href="#ref-for-permission-revocation-algorithm④">10.10. 
      Gyroscope </a>
    <li><a href="#ref-for-permission-revocation-algorithm⑤">10.11. 
      Magnetometer </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="boolean-feature">
   <b><a href="#boolean-feature">#boolean-feature</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-boolean-feature">10.1. 
      Geolocation </a>
    <li><a href="#ref-for-boolean-feature①">10.2. 
      Notifications </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-geolocation">
   <b><a href="#dom-permissionname-geolocation">#dom-permissionname-geolocation</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-geolocation">10. 
    Permission Registry </a>
    <li><a href="#ref-for-dom-permissionname-geolocation①">12. 
    Examples </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-notifications">
   <b><a href="#dom-permissionname-notifications">#dom-permissionname-notifications</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-notifications">10. 
    Permission Registry </a>
    <li><a href="#ref-for-dom-permissionname-notifications①">12. 
    Examples </a> <a href="#ref-for-dom-permissionname-notifications②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-push">
   <b><a href="#dom-permissionname-push">#dom-permissionname-push</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-push">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-midi">
   <b><a href="#dom-permissionname-midi">#dom-permissionname-midi</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-midi">4. 
    Descriptions of permission requests </a>
    <li><a href="#ref-for-dom-permissionname-midi①">10. 
    Permission Registry </a> <a href="#ref-for-dom-permissionname-midi②">(2)</a> <a href="#ref-for-dom-permissionname-midi③">(3)</a>
    <li><a href="#ref-for-dom-permissionname-midi④">10.4. 
      Midi </a>
    <li><a href="#ref-for-dom-permissionname-midi⑤">11.1. 
      Set Permission </a> <a href="#ref-for-dom-permissionname-midi⑥">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-camera">
   <b><a href="#dom-permissionname-camera">#dom-permissionname-camera</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-camera">10. 
    Permission Registry </a>
    <li><a href="#ref-for-dom-permissionname-camera①">10.5. 
      Media Devices </a> <a href="#ref-for-dom-permissionname-camera②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-microphone">
   <b><a href="#dom-permissionname-microphone">#dom-permissionname-microphone</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-microphone">10. 
    Permission Registry </a>
    <li><a href="#ref-for-dom-permissionname-microphone①">10.5. 
      Media Devices </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-speaker">
   <b><a href="#dom-permissionname-speaker">#dom-permissionname-speaker</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-speaker">10. 
    Permission Registry </a>
    <li><a href="#ref-for-dom-permissionname-speaker①">10.5. 
      Media Devices </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-devicepermissiondescriptor-deviceid">
   <b><a href="#dom-devicepermissiondescriptor-deviceid">#dom-devicepermissiondescriptor-deviceid</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-devicepermissiondescriptor-deviceid">10.5. 
      Media Devices </a> <a href="#ref-for-dom-devicepermissiondescriptor-deviceid①">(2)</a> <a href="#ref-for-dom-devicepermissiondescriptor-deviceid②">(3)</a> <a href="#ref-for-dom-devicepermissiondescriptor-deviceid③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-device-info">
   <b><a href="#dom-permissionname-device-info">#dom-permissionname-device-info</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-device-info">10. 
    Permission Registry </a>
    <li><a href="#ref-for-dom-permissionname-device-info①">10.5. 
      Media Devices </a> <a href="#ref-for-dom-permissionname-device-info②">(2)</a> <a href="#ref-for-dom-permissionname-device-info③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-background-fetch">
   <b><a href="#dom-permissionname-background-fetch">#dom-permissionname-background-fetch</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-background-fetch">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-background-sync">
   <b><a href="#dom-permissionname-background-sync">#dom-permissionname-background-sync</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-background-sync">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-ambient-light-sensor">
   <b><a href="#dom-permissionname-ambient-light-sensor">#dom-permissionname-ambient-light-sensor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-ambient-light-sensor">10. 
    Permission Registry </a>
    <li><a href="#ref-for-dom-permissionname-ambient-light-sensor①">10.8. 
      Ambient Light Sensor </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-accelerometer">
   <b><a href="#dom-permissionname-accelerometer">#dom-permissionname-accelerometer</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-accelerometer">10. 
    Permission Registry </a> <a href="#ref-for-dom-permissionname-accelerometer①">(2)</a>
    <li><a href="#ref-for-dom-permissionname-accelerometer②">10.9. 
      Accelerometer </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-gyroscope">
   <b><a href="#dom-permissionname-gyroscope">#dom-permissionname-gyroscope</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-gyroscope">10. 
    Permission Registry </a> <a href="#ref-for-dom-permissionname-gyroscope①">(2)</a>
    <li><a href="#ref-for-dom-permissionname-gyroscope②">10.10. 
      Gyroscope </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-magnetometer">
   <b><a href="#dom-permissionname-magnetometer">#dom-permissionname-magnetometer</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-magnetometer">10. 
    Permission Registry </a> <a href="#ref-for-dom-permissionname-magnetometer①">(2)</a>
    <li><a href="#ref-for-dom-permissionname-magnetometer②">10.11. 
      Magnetometer </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-clipboard">
   <b><a href="#dom-permissionname-clipboard">#dom-permissionname-clipboard</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-clipboard">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-display-capture">
   <b><a href="#dom-permissionname-display-capture">#dom-permissionname-display-capture</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-display-capture">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionname-nfc">
   <b><a href="#dom-permissionname-nfc">#dom-permissionname-nfc</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionname-nfc">10. 
    Permission Registry </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-permissionsetparameters">
   <b><a href="#dictdef-permissionsetparameters">#dictdef-permissionsetparameters</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-permissionsetparameters">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionsetparameters-descriptor">
   <b><a href="#dom-permissionsetparameters-descriptor">#dom-permissionsetparameters-descriptor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionsetparameters-descriptor">11.1. 
      Set Permission </a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionsetparameters-state">
   <b><a href="#dom-permissionsetparameters-state">#dom-permissionsetparameters-state</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionsetparameters-state">11.1. 
      Set Permission </a> <a href="#ref-for-dom-permissionsetparameters-state①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-permissionsetparameters-onerealm">
   <b><a href="#dom-permissionsetparameters-onerealm">#dom-permissionsetparameters-onerealm</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-permissionsetparameters-onerealm">11.1. 
      Set Permission </a>
   </ul>
  </aside>
<script>/* script-var-click-highlighting */

    document.addEventListener("click", e=>{
        if(e.target.nodeName == "VAR") {
            highlightSameAlgoVars(e.target);
        }
    });
    {
        const indexCounts = new Map();
        const indexNames = new Map();
        function highlightSameAlgoVars(v) {
            // Find the algorithm container.
            let algoContainer = null;
            let searchEl = v;
            while(algoContainer == null && searchEl != document.body) {
                searchEl = searchEl.parentNode;
                if(searchEl.hasAttribute("data-algorithm")) {
                    algoContainer = searchEl;
                }
            }

            // Not highlighting document-global vars,
            // too likely to be unrelated.
            if(algoContainer == null) return;

            const algoName = algoContainer.getAttribute("data-algorithm");
            const varName = getVarName(v);
            const addClass = !v.classList.contains("selected");
            let highlightClass = null;
            if(addClass) {
                const index = chooseHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] += 1;
                indexNames.set(algoName+"///"+varName, index);
                highlightClass = nameFromIndex(index);
            } else {
                const index = previousHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] -= 1;
                highlightClass = nameFromIndex(index);
            }

            // Find all same-name vars, and toggle their class appropriately.
            for(const el of algoContainer.querySelectorAll("var")) {
                if(getVarName(el) == varName) {
                    el.classList.toggle("selected", addClass);
                    el.classList.toggle(highlightClass, addClass);
                }
            }
        }
        function getVarName(el) {
            return el.textContent.replace(/(\s| )+/, " ").trim();
        }
        function chooseHighlightIndex(algoName, varName) {
            let indexes = null;
            if(indexCounts.has(algoName)) {
                indexes = indexCounts.get(algoName);
            } else {
                // 7 classes right now
                indexes = [0,0,0,0,0,0,0];
                indexCounts.set(algoName, indexes);
            }

            // If the element was recently unclicked,
            // *and* that color is still unclaimed,
            // give it back the same color.
            const lastIndex = previousHighlightIndex(algoName, varName);
            if(indexes[lastIndex] === 0) return lastIndex;

            // Find the earliest index with the lowest count.
            const minCount = Math.min.apply(null, indexes);
            let index = null;
            for(var i = 0; i < indexes.length; i++) {
                if(indexes[i] == minCount) {
                    return i;
                }
            }
        }
        function previousHighlightIndex(algoName, varName) {
            return indexNames.get(algoName+"///"+varName);
        }
        function nameFromIndex(index) {
            return "selected" + index;
        }
    }
    </script>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>